package mainpackage;

import engine.ani.Npc;
import engine.ani.OtherPlayer;
import engine.ani.Player;
import engine.damage.Damage;
import engine.map.Map;
import engine.net.NetManager;
import engine.skill.SkillBuffManager;
import engine.skill.SkillManager;
import function.GameSet;
import function.Property;
import function.QuickOption;
import function.SysMessage;
import java.io.DataInputStream;
import java.util.Vector;
import net.NetController;
import ui.UiEquipment;
import ui.UiInterFace;
import ui.UiLogin;
import ui.UiPackage;

/**
 * <p>Title: 游戏逻辑类</p>
 * <p>Description: 主要负责游戏逻辑更新</p>
 * <p>Copyright: Copyright (c) 2010</p>
 * <p>Company: </p>
 * @author hlw
 * @version 1.0
 *///
public class MainLogic {

    /****************************************测试用临时数据*****************************************/
    //测试用联网数据 
    public static int i_receive_msgId = -99;
    public static int i_send_msgId = -99;
    //本类单例
    public static MainLogic logic;
    public static NetController netController;
    public static UiPackage uiPackage = new UiPackage();
    public static UiEquipment uiEquipment = new UiEquipment();
    public static UiInterFace uiInterFace;
    public static UiLogin uiLogin;
    //add by xiongfangwei
    //用户输入数据的高级界面接口
    public static InputInterFace inputInterFace = InputInterFace.getInstance();
    //资源管理
    public static ResManager aResManager = null;
    //end
    //是否登入了游戏
    public static boolean blLogined;
    //游戏状态
    public static byte byGameState;
    //创建状态栈
    public static Vector state;
    //资源初始化结束标记
    private static boolean blInitFinished = true;
    //npc对象
    public static Npc gameNpcArray = null;
    //其他玩家对象
    public OtherPlayer gameOtherplayerArray = null;
    //游戏玩家
    //女
    public static Player gamePlayer = null;
    //技能
    public SkillManager aSkillManager = null;
//    public SkillBuff aSkillBuff;
    //s
    public static long[][] iLockedObjNumber;
    public static int[] iLockedObjInfor;
    public static long lLockedId;//被锁定玩家（NPC）ID
    public static byte bLockedSex;//被锁定玩家性别
    public static byte bLockedDifficulty;//被锁定NPC性别
    public static byte bLockedDuty;//被锁定玩家性别
    public static String sLockedTongNo;//被锁定玩家帮派代号
    private boolean blCursorTurnGame;
    public int iTimeDelay;
    public static boolean bSendOnScreen = false;
    //864b0300020002
//  public Map gameMap =null;
    public static Damage damage;
    //地图数据
    public static Map gameMap = null;
    /******************临时测试用的变量***************************/
    //测试技能用
    //创建角色后的返回的角色ID;
    public static long lPlayerID = 0L;
    //客户端相对于服务器当前时间
    public static long lClientCurrentTime = System.currentTimeMillis();
    //服务器端时间
    public static long lServerCurrentTime = 0L;
    //客户端和服务器端时间差
    public static long lCSSpaceTime = 0L;
    public static boolean bltime = true;
    //客户端和服务器端延迟时间
    public static long lCSDelayTime = 0L;
    public static int iDelayTimeIndex = 0;
    public static long[] lCSDelayTimeCount = new long[3];
//    public static String[] sSkillArray = new String[]{
//        "010201", "010101", "020201"
//    };
//    public static int iCount = 0;
//    public static int iCount2 = 0;
//    public static String[] sLearnedSkill = new String[sSkillArray.length];
//    public static String[] sMeridianArray = new String[]{
//        "10101", "10102", "20101", "30101"
//    };
    public static boolean bSendLockedNpcInfo = false;
    //测试走路的间隔时间
    public static long lRunpaceTime = 0L;
    //流量统计
    public static long lFlowCount = 0;
    public static boolean byQuickToRoam = false;
    public static boolean bClientIsReady = false;
    public static boolean bCanStartGuide = false;//是否可以开始引导了
    public static short shFrameCount = 0;//帧数记录

    /********************************************************************/
    public MainLogic() {
        //可以进入游戏后载入

        state = new Vector(20, 10);
        netController = new NetController();
        //游戏UI初始化
        uiInterFace = new UiInterFace();
        aSkillManager = new SkillManager();
        uiLogin = new UiLogin();
        initGame();
        try {
//            //与服务器建立连接
//            NetManager.getInstance().closeConnect();
//            //启动内部消息线程
            if (!Constant.b_QUICK_DEBUG_GAME_UI) {
                //#if USER_CENTER=="TRUE"    
                //#else 
                //#if  NOKIA_S40V3 || NORMAL_240_400 || MOT0 || K790
                //#else
//#                 NetManager.getNewInstance().startNetManager();
                //#endif
                //#endif
            }
//            //设置游戏绘制状态
            this.pushState(Constant.GAME_UI_LOGO, true);
        } catch (Exception ex) {
            if (Constant.DEBUG) {
                ex.printStackTrace();
            }
        }
    }

    /**
     * 初始化游戏
     */
    public void initGame() {
        try {
            aResManager = new ResManager();
            damage = new Damage();
            damage.initDamage();
            this.gameNpcArray = new Npc();
            this.gameOtherplayerArray = new OtherPlayer();
            gameMap = new Map();
            //光标锁定
            iLockedObjNumber = new long[Constant.MAX_LOCKED_MAXNUMS][6];
            iLockedObjInfor = null;
            shFrameCount = 211;
//            this.uiInterFace.initRoamUI();
            for (int i = 0; i < Constant.MAX_LOCKED_MAXNUMS; i++) {
                iLockedObjNumber[i][0] = -1;//id
                iLockedObjNumber[i][1] = -1;//索引
                iLockedObjNumber[i][2] = -1;//x
                iLockedObjNumber[i][3] = -1;//y
                iLockedObjNumber[i][4] = -1;//锁定类型 0 NPC 1OTHERPLAYER
                iLockedObjNumber[i][5] = -1;//锁定目标是否获得了服务器信息更新
            }
            MainLogic.uiInterFace.quickOption.addQuickOption("0|/继续任务", false);
//            MainLogic.uiInterFace.quickOption.addQuickOption("0|/继续任务",true);

        } catch (Exception e) {
            if (Constant.DEBUG) {
                e.printStackTrace();
            }
        }
    }

    public static MainLogic getInstance() {
        if (logic == null) {
            logic = new MainLogic();
        }
        return logic;
    }

    /**
     * 设置游戏状态
     * @param state 游戏状态值
     * @param isClear 是否清空所有状态的资源
     */
    public static void pushState(byte astate, boolean isClear) {
        if (NetManager.blUnUsed && astate == Constant.GAME_UI_ROAM) {
            astate = Constant.GAME_UI_LOGO;
        }
        if (Player.blPlayerDie && astate != Constant.GAME_UI_REVIVE) {
            astate = Constant.GAME_UI_REVIVE;
        }
        //寻路状态过图后重新寻路
        if (byGameState == Constant.GAME_UI_LOADING && astate == Constant.GAME_UI_ROAM) {
            Player.blAutoRunStartCheck = true;
            blLogined = true;
            GameBean.SCREEN_TYPE = 1;
            MainLogic.getInstance().send(Constant.MSG_NET_CMD_OPT_ON_SCREEN, Constant.SOCKET_MSG_TYPE_LOGIC);
//            GameBean.BL_ROAMLOGIC_LOCK = false;
        }
        if (astate == Constant.GAME_UI_LOADING) {
            if (UiInterFace.isOpenSound) {
                if (UiInterFace.SetPlayMusic) {
                    UiInterFace.firstUiMusic = false;
                }
            }

        }

        if (astate == Constant.GAME_UI_ROAM || astate == Constant.GAME_UI_OPEN_SCREEN) {
            if (UiInterFace.isOpenSound) {
                if (UiInterFace.SetPlayMusic) {
                    if (!UiInterFace.firstUiMusic) {
                        //#if NOKIAN73 || NOKIA_S40V3  || MOT0 || K790
                        //#else
                        SoundPlayerUtil.stopAllMusic();
                        UiInterFace.firstUiMusic = true;
                        if (MainLogic.getInstance().uiInterFace.sRoamMapKeys.substring(0, 4).equals("1060")) {
                            SoundPlayerUtil.playmusic(1);
                        } else if (MainLogic.getInstance().uiInterFace.sRoamMapKeys.substring(0, 4).equals("1020")
                                || MainLogic.getInstance().uiInterFace.sRoamMapKeys.substring(0, 4).equals("1030")
                                || MainLogic.getInstance().uiInterFace.sRoamMapKeys.substring(0, 4).equals("1040")
                                || MainLogic.getInstance().uiInterFace.sRoamMapKeys.substring(0, 4).equals("1050")) {
                            SoundPlayerUtil.playmusic(2);
                        } else {
                            SoundPlayerUtil.playmusic(0);
                        }
                        //#endif
                    }
                }
            }
        }

        blInitFinished = false;
        //上一个状态
        byte byOldState = byGameState;
        //初始化游戏模块
        //清理资源
        if (byOldState != astate) {
            clear(byOldState);
        }
        byGameState = astate;
        init(astate);
        Byte byObj = new Byte(astate);
        if (isClear) {
            if (state.size() > 0) {
                state.removeAllElements();
            }
            state.addElement(byObj);
        } else {
            state.addElement(byObj);
        }
        blInitFinished = true;
    }

    /**
     * 游戏状态值出栈
     * @return byte
     */
    public byte popState() {
        int nums = this.state.size();
        int index = nums - 1 > 0 ? nums - 1 : 0;
        Byte byObj = (Byte) this.state.elementAt(index == 0 ? 0 : (index - 1));
        this.byGameState = byObj.byteValue();
        if (index > 0) {
            //清理不需要的模块
            Byte clearState = (Byte) this.state.elementAt(index);
            this.clear(clearState.byteValue());
            this.state.removeElementAt(index);
        }
        return byObj.byteValue();
    }

    /**
     * 游戏各状态的初始化
     * @param state 游戏状态
     */
    public static void init(byte state) {
        GameBean.b_WAIT_NET_MSG_BACK = false;
        switch (state) {
            case Constant.GAME_UI_ROAM:
                if (!uiInterFace.bRoamUIInit) {
                    uiInterFace.initRoamUI();
                    uiInterFace.bRoamUIInit = true;
                    GameBean.L_QUICK_REGISTER_START_TIME = System.currentTimeMillis();
//                    if (bCanStartGuide && MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] < 0
//                            && MainLogic.getInstance().uiInterFace.sysMessage.saveStateGuide < 0) {
//                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 0, 0);
//                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 0;
//                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 0;
//                        MainLogic.getInstance().uiInterFace.sysMessage.saveGuide(0);
//                    }
                    MainLogic.getInstance().send(Constant.MSG_NET_CMD_CLIENT_READY, Constant.SOCKET_MSG_TYPE_LOGIC);
                }
                break;
            //游戏登录几个登录界面UI
            case Constant.GAME_UI_LOADING:
                uiInterFace.initLoading();
                break;
            case Constant.GAME_UI_LOGO:
                uiLogin.initLogo();
                break;
            case Constant.GAME_UI_OPTION_LIST:
                uiLogin.initOptionList();
                break;
            case Constant.GAME_UI_OVER:
                uiLogin.initOver();
                break;
            case Constant.GAME_UI_LOGIN:
                uiLogin.initLogin();
                break;
            case Constant.GAME_UI_SERVER_LIST:
                uiLogin.initServerList();
                break;
            case Constant.GAME_UI_CREATE_ROLE:
                uiLogin.initCreateRole();
                break;
            case Constant.GAME_UI_NPC_TALK:
                //在其他地方初始化
                uiInterFace.npcTalk.initNPCTalk();
                break;
            case Constant.GAME_UI_ROAM_MENU:
                uiInterFace.initRoamMenu();
                break;
            case Constant.GAME_UI_ACCEPT_TASK:
                uiInterFace.npcTalk.initTask();
                break;
            case Constant.GAME_UI_PACKAGE:
                uiPackage.initPackage();
                break;
            case Constant.GAME_UI_EQUIPMENT:
                uiPackage.initEquip();
                break;
            case Constant.GAME_UI_SKILL:
                uiEquipment.init();
                break;
            case Constant.GAME_UI_EXCHANGE:
                uiEquipment.init();
                break;
            case Constant.GAME_UI_GAMESET:
                uiEquipment.init();
                break;
            case Constant.GAME_UI_OPEN_SCREEN:
                uiLogin.initOpenScreen();
                break;
            case Constant.GAME_UI_CHAT:
            case Constant.GAME_UI_CHAT_SECOND:
            case Constant.GAME_UI_SMILE:
            case Constant.GAME_UI_CHAT_SET:
                uiEquipment.init();
                break;
            case Constant.GAME_UI_CONNECTION_AGAIN:
                uiEquipment.init();
                break;
            case Constant.GAME_UI_TEAM_INFO:
                uiInterFace.team.initTeamInfo();
                break;
            case Constant.GAME_UI_VIEW_OTHER_PLAYER:
//                uiInterFace.initOtherPlayerInfo();
                uiInterFace.initLockPlayer();
                break;
            case Constant.GAME_UI_LOOK_OTHERPLAYER://查看其他玩家
                uiInterFace.initOtherPlayerLooked();
                break;
            case Constant.GAME_UI_TEAM_ANSWER:
                uiInterFace.team.initTeamAnswer();
                break;
            case Constant.GAME_UI_TASK_LIST:
                uiInterFace.npcTalk.initTaskList();
                break;
            case Constant.GAME_UI_CREATE_TONG:
                uiInterFace.tong.initCreateTong();
                break;
            case Constant.GAME_UI_TONG_LIST:
                uiInterFace.tong.initTongList();
                break;
            case Constant.GAME_UI_TONG_SKILL:
                uiInterFace.tong.initTongSkill();
                break;
            case Constant.GAME_UI_TONG_MEMBER_LIST:
                uiInterFace.tong.initTongMemberList();
                break;
            case Constant.GAME_UI_TONG_INFO:
                uiInterFace.tong.initTongInfo();
                break;
            case Constant.GAME_UI_TONG_BUILDING:
                uiInterFace.tong.initTongBuilding();
                break;
            case Constant.GAME_UI_PET_COMPOSE:
                MainLogic.getInstance().uiInterFace.pet.initPetCompose();
                break;
            case Constant.GAME_UI_PET_EQUIP:
                MainLogic.getInstance().uiInterFace.pet.initPetEquip();
                break;
            case Constant.GAME_UI_GAMESET_QUICKEYS:
                UiInterFace.gameSet.initQuickSet();
                break;
            case Constant.GAME_UI_SEND_EMAIL:
            case Constant.GAME_UI_VIEW_EMAIL://查看邮件
                uiEquipment.init();
                break;
            case Constant.GAME_UI_RECEIVE_EMAIL:
            case Constant.GAME_UI_OPERATION_EMAIL:
                uiEquipment.init();
                break;
            case Constant.GAME_UI_MERIDIANS:
                uiEquipment.init();
                break;
            case Constant.GAME_UI_MAP_WORLD:
                uiEquipment.init();
                break;
            case Constant.GAME_UI_NOTICE_LIST:
                uiEquipment.init();
                break;
            //物品合成
            case Constant.GAME_UI_ITEMS_COMPOSE:
                UiInterFace.equipment.initItemsCompose();
                break;
            //物品强化
            case Constant.GAME_UI_ITEMS_STRENGTHEN:
                UiInterFace.equipment.initItemsStrengthen();
                break;
            //物品分解
            case Constant.GAME_UI_ITEMS_DECOMPOSE:
                UiInterFace.equipment.initItemsDecompose();
                break;
            //物品打孔镶嵌拆分
            case Constant.GAME_UI_EQUIP_OPERATION:
                UiInterFace.equipment.initEquipOperation();
                break;
            //好友列表
            case Constant.GAME_UI_FRIEND_LIST:
                UiInterFace.friend.initFriendList();
                break;
            case Constant.GAME_UI_STORE_SOLD:
                UiInterFace.store.initStoreSold();
                //出售
                break;
            case Constant.GAME_UI_STORE_BUY:
                UiInterFace.store.initStoreBuy();
                //购买
                break;
            case Constant.GAME_UI_TRADE:
                UiInterFace.store.initTrade();
                break;
            case Constant.GAME_UI_TRADE_ANSWER:
                UiInterFace.store.initTradeAnswer();
                break;
            case Constant.GAME_UI_WAREHOUSE:
                UiInterFace.store.initWareHouse();
                break;
            case Constant.GAME_UI_PLAYER_INFO:
                UiInterFace.property.initPlayerInfo();
                break;
            case Constant.GAME_UI_PROPERTY_ADD_POINT:
                UiInterFace.property.initPropertyAddPoint();
                break;
            case Constant.GAME_UI_REVIVE:
                uiInterFace.initRevive();
                break;
            case Constant.GAME_UI_EQUIP_REPAIR:
                uiInterFace.npcTalk.initRepairEquip();
                break;
            case Constant.GAME_UI_CONTEST_ANSWER:
                uiInterFace.initContest();
                break;
            case Constant.GAME_UI_TONG_MENU:
                uiInterFace.tong.initTongMenu();
                break;
            case Constant.GAME_UI_NEAR_PLAYER_LIST:
                uiInterFace.initNearPlayerList();
                break;
            case Constant.GAME_UI_PET_POWER_STRENGTHEN:
                MainLogic.getInstance().uiInterFace.pet.initPetPowerStrength();
                break;
            case Constant.GAME_UI_TRANSFER_LIST:
                MainLogic.getInstance().uiInterFace.npcTalk.initTransferList();
                break;
            case Constant.GAME_UI_APPLY_TONG_LIST:
                uiInterFace.tong.initApplyTongList();
                break;
            case Constant.GAME_UI_TASK_AUTO_FIND_PATH:
                uiInterFace.npcTalk.initTaskAutoFindPath();
                break;
            case Constant.GAME_UI_HELP:
                uiLogin.initHelp();
                break;
            case Constant.GAME_UI_ABOUT:
                uiLogin.initAbout();
                break;
            case Constant.GAME_UI_SET:
                uiLogin.initSet();
                break;
            case Constant.GAME_UI_UPDATE:
                uiLogin.initUpdate();
                break;
            case Constant.GAME_UI_QUESTION:
                uiInterFace.initQuestion();
                break;
            case Constant.GAME_UI_INGOT_STORE:
                uiInterFace.store.initIngotStore();
                break;
            case Constant.GAME_UI_WAGE_STORE:
                uiInterFace.store.initWageStore();
                break;
            case Constant.GAME_UI_INGOT_RECORD:
                uiInterFace.store.initIngotRecord();
                break;
            case Constant.GAME_UI_PUNCH_CLOCK:
                uiInterFace.initPunchClock();
                break;
            case Constant.GAME_UI_FUNC_DESC:
                uiInterFace.npcTalk.initFuncDesc();
                break;
            case Constant.GAME_UI_BUFFER_LIST:
                uiInterFace.property.initBufferList();
                break;
            case Constant.GAME_UI_FUNC_SETTING:
                uiInterFace.gameSet.initFuncSetting();
                break;
            case Constant.GAME_UI_QUICK_OPTION:
                uiInterFace.quickOption.initQuickOption();
                break;
            case Constant.GAME_UI_PLAYER_TOP:
                uiInterFace.property.initPlayerTop();
                break;
            case Constant.GAME_UI_PLAYER_STALL:
                uiInterFace.store.initPlayerStall();
                break;
            case Constant.GAME_UI_HANGUP:
                uiInterFace.property.initHangUp();
                break;
            case Constant.GAME_UI_CHANGE_PASSWD:
                uiInterFace.initChangePasswd();
                break;
            case Constant.GAME_UI_NETWORK_SELECT:
                uiLogin.initNetworkSelect();
                break;
            case Constant.GAME_UI_CHARGE:
                uiInterFace.gameSet.initCharge();
                break;
            case Constant.GAME_UI_CHARGE_LIST:
                uiInterFace.gameSet.initChargeList();
                break;
        }
        if (SysMessage.initWaiting) {
            MainLogic.getInstance().uiInterFace.sysMessage.initSysGuidefinish();
            SysMessage.initWaiting = false;
        }
        if (initMLogicWaiting) {
            MainLogic.getInstance().initGuidefinish();
            MainLogic.getInstance().initMLogicWaiting = false;
        }

    }

    /**
     * 清理各模块资源
     */
    public static void clear(byte state) {
        switch (state) {
            case Constant.GAME_UI_ROAM:
                //uiInterFace.clearRoamUI();
                break;
            case Constant.GAME_UI_LOADING:
                uiInterFace.clearLoading();
                break;
            //游戏登录几个登录界面UI
            case Constant.GAME_UI_LOGO:
                uiLogin.clearLogo();
                break;
            case Constant.GAME_UI_OPTION_LIST:
                uiLogin.clearOptionList();
                break;
            case Constant.GAME_UI_OVER:
                uiLogin.clearOver();
                break;
            case Constant.GAME_UI_LOGIN:
                uiLogin.clearLogin();
                break;
            case Constant.GAME_UI_SERVER_LIST:
                uiLogin.clearServerList();
                break;
            case Constant.GAME_UI_CREATE_ROLE:
                uiLogin.clearCreateRole();
                break;
            case Constant.GAME_UI_NPC_TALK:
                uiInterFace.npcTalk.clearNPCTalk();
                break;
            case Constant.GAME_UI_ROAM_MENU:
                uiInterFace.clearRoamMenu();
                break;
            case Constant.GAME_UI_ACCEPT_TASK:
                uiInterFace.npcTalk.clearTask();
                break;
            case Constant.GAME_UI_PACKAGE:
                uiPackage.clearPackage();
                break;
            case Constant.GAME_UI_EQUIPMENT:
                uiPackage.clearEquip();
                break;
            case Constant.GAME_UI_SKILL:
                uiEquipment.clearSkill();
                break;
            case Constant.GAME_UI_EXCHANGE:
                uiEquipment.clearExchange();
                break;
            case Constant.GAME_UI_GAMESET:
                uiEquipment.clearGameset();
                break;
            case Constant.GAME_UI_OPEN_SCREEN:
                uiLogin.clearOpenScreen();
                break;
            case Constant.GAME_UI_CHAT:
            case Constant.GAME_UI_CHAT_SECOND:
            case Constant.GAME_UI_SMILE://表情
            case Constant.GAME_UI_CHAT_SET://聊天设置
                uiEquipment.clearChat();
                break;
            case Constant.GAME_UI_CONNECTION_AGAIN:
                uiEquipment.clearConnecAgain();
                break;
            case Constant.GAME_UI_SEND_EMAIL://发送邮件
            case Constant.GAME_UI_VIEW_EMAIL://查看邮件
                uiEquipment.clearEmail();
                break;
            case Constant.GAME_UI_RECEIVE_EMAIL://接收邮件
            case Constant.GAME_UI_OPERATION_EMAIL:
                uiEquipment.clearReceiveEmail();
                break;
            case Constant.GAME_UI_MERIDIANS:
                uiEquipment.clearMeridians();
                break;
            case Constant.GAME_UI_MAP_WORLD:
                uiEquipment.clearWorld();
                break;
            case Constant.GAME_UI_NOTICE_LIST:
                uiEquipment.clearNoticeList();
                break;
            case Constant.GAME_UI_TEAM_INFO:
                uiInterFace.team.clearTeamInfo();
                break;
            case Constant.GAME_UI_VIEW_OTHER_PLAYER:
//                uiInterFace.clearOtherPlayerInfo();
                uiInterFace.clearLockPlayer();
                break;
            case Constant.GAME_UI_LOOK_OTHERPLAYER://查看其他玩家
                uiInterFace.clearOtherPlayerLooked();
                break;
            case Constant.GAME_UI_TEAM_ANSWER:
                uiInterFace.team.clearTeamAnswer();
                break;
            case Constant.GAME_UI_TASK_LIST:
                uiInterFace.npcTalk.clearTaskList();
                break;
            case Constant.GAME_UI_CREATE_TONG:
                uiInterFace.tong.clearCreateTong();
                break;
            case Constant.GAME_UI_TONG_LIST:
                uiInterFace.tong.clearTongList();
                break;
            case Constant.GAME_UI_TONG_SKILL:
                break;
            case Constant.GAME_UI_TONG_MEMBER_LIST:
                uiInterFace.tong.clearTongMemberList();
                break;
            case Constant.GAME_UI_TONG_INFO:
                uiInterFace.tong.clearTongInfo();
                break;
            case Constant.GAME_UI_TONG_BUILDING:
                uiInterFace.tong.clearTongBuilding();
                break;
            case Constant.GAME_UI_PET_COMPOSE:
                MainLogic.getInstance().uiInterFace.pet.clearPetCompose();
                break;
            case Constant.GAME_UI_PET_EQUIP:
                MainLogic.getInstance().uiInterFace.pet.clearPetEquip();
                break;
            case Constant.GAME_UI_GAMESET_QUICKEYS:
                UiInterFace.gameSet.clearQuickSet();
                break;
            //物品合成
            case Constant.GAME_UI_ITEMS_COMPOSE:
                UiInterFace.equipment.clearItemsCompose();
                break;
            //物品强化
            case Constant.GAME_UI_ITEMS_STRENGTHEN:
                UiInterFace.equipment.clearItemsStrengthen();
                break;
            //物品分解
            case Constant.GAME_UI_ITEMS_DECOMPOSE:
                UiInterFace.equipment.clearItemsDecompose();
                break;
            //物品打孔镶嵌拆分
            case Constant.GAME_UI_EQUIP_OPERATION:
                UiInterFace.equipment.clearEquipOperation();
                break;
            //好友列表
            case Constant.GAME_UI_FRIEND_LIST:
                uiInterFace.friend.clearFriendList();
                break;
            case Constant.GAME_UI_STORE_SOLD:
                //UiInterFace.store.clearStoreSold();
                break;
            //出售
            case Constant.GAME_UI_STORE_BUY:
            //购买
            case Constant.GAME_UI_TRADE:
            case Constant.GAME_UI_TRADE_ANSWER:
                UiInterFace.store.clear();
                break;
            case Constant.GAME_UI_WAREHOUSE:
                UiInterFace.store.clearWareHouse();
                break;
            case Constant.GAME_UI_PLAYER_INFO:
                UiInterFace.property.clearPlayerInfo();
                break;
            case Constant.GAME_UI_PROPERTY_ADD_POINT:
                UiInterFace.property.clearPropertyAddPoint();
                break;
            case Constant.GAME_UI_REVIVE:
                uiInterFace.clearRevive();
                break;
            case Constant.GAME_UI_EQUIP_REPAIR:
                uiInterFace.npcTalk.clearRepairEquip();
                break;
            case Constant.GAME_UI_CONTEST_ANSWER:
                uiInterFace.clearContest();
                break;
            case Constant.GAME_UI_TONG_MENU:
                uiInterFace.tong.clearTongMenu();
                break;
            case Constant.GAME_UI_NEAR_PLAYER_LIST:
                uiInterFace.clearNearPlayerList();
                break;
            case Constant.GAME_UI_PET_POWER_STRENGTHEN:
                MainLogic.getInstance().uiInterFace.pet.clearPetPowerStrength();
                break;
            case Constant.GAME_UI_TRANSFER_LIST:
                uiInterFace.npcTalk.clearTransferList();
                break;
            case Constant.GAME_UI_APPLY_TONG_LIST:
                uiInterFace.tong.clearApplyTongList();
                break;
            case Constant.GAME_UI_TASK_AUTO_FIND_PATH:
                uiInterFace.npcTalk.clearTaskAutoFindPath();
                break;
            case Constant.GAME_UI_HELP:
                uiLogin.clearHelp();
                break;
            case Constant.GAME_UI_ABOUT:
                uiLogin.clearAbout();
                break;
            case Constant.GAME_UI_SET:
                uiLogin.clearSet();
                break;
            case Constant.GAME_UI_UPDATE:
                uiLogin.clearUpdate();
                break;
            case Constant.GAME_UI_QUESTION:
                uiInterFace.clearQuestion();
                break;
            case Constant.GAME_UI_INGOT_STORE:
                uiInterFace.store.clearIngotStore();
                break;
            case Constant.GAME_UI_WAGE_STORE:
                uiInterFace.store.clearWageStore();
                break;
            case Constant.GAME_UI_INGOT_RECORD:
                uiInterFace.store.clearIngotRecord();
                break;
            case Constant.GAME_UI_PUNCH_CLOCK:
                uiInterFace.clearPunchClock();
                break;
            case Constant.GAME_UI_FUNC_DESC:
                uiInterFace.npcTalk.clearFuncDesc();
                break;
            case Constant.GAME_UI_BUFFER_LIST:
                uiInterFace.property.clearBufferList();
                break;
            case Constant.GAME_UI_FUNC_SETTING:
                uiInterFace.gameSet.clearFuncSetting();
                break;
            case Constant.GAME_UI_QUICK_OPTION:
                uiInterFace.quickOption.clearQuickOption();
                break;
            case Constant.GAME_UI_PLAYER_TOP:
                uiInterFace.property.clearPlayerTop();
                break;
            case Constant.GAME_UI_PLAYER_STALL:
                uiInterFace.store.clearPlayerStall();
                break;
            case Constant.GAME_UI_HANGUP:
                uiInterFace.property.clearHangUp();
                break;
            case Constant.GAME_UI_CHANGE_PASSWD:
                uiInterFace.clearChangePasswd();
                break;
            case Constant.GAME_UI_NETWORK_SELECT:
                uiLogin.clearNetWorkSelect();
                break;
            case Constant.GAME_UI_CHARGE:
                uiInterFace.gameSet.clearCharge();
                break;
            case Constant.GAME_UI_CHARGE_LIST:
                uiInterFace.gameSet.clearChargeList();
                break;
        }
        ResManager.clearRes(Constant.RES_PUBLIC_TEMP);
        System.gc();
    }

    /**
     * 游戏主逻辑
     */
    public void update() {
        try {
            netController.runMessageQueue();
            if (bClientIsReady) {
                //心跳消息
//                if (System.currentTimeMillis() - MainCanvas.lstarTime > MainCanvas.lconTime) {
//                    MainCanvas.lstarTime = System.currentTimeMillis();
//                    this.send(Constant.MSG_NET_CMDSYN_TIME, Constant.SOCKET_MSG_TYPE_HEART);
//                }
                if (this.shFrameCount > 210) {
                    MainCanvas.lstarTime = System.currentTimeMillis();
                    this.shFrameCount = 0;
                    this.send(Constant.MSG_NET_CMDSYN_TIME, Constant.SOCKET_MSG_TYPE_HEART);
                } else {
                    this.shFrameCount++;
                }
                if (System.currentTimeMillis() - Constant.spacetime > 240000) {//断线重连
                    Constant.again_connection = true;
                    MainLogic.getInstance().pushState(Constant.GAME_UI_CONNECTION_AGAIN, true);
                }
            }
            if (uiInterFace.team.bShowRollPopUp) {
                uiInterFace.team.updateItemRoll();
            }
            //显示提示信息
            if (uiInterFace.sysMessage.bShowPopUpMessage) {
                uiInterFace.sysMessage.updateShowMessage();
            }
            if (LocalMsgManager.bInHttpConnect) {
                LocalMsgManager.getInstance().updateHttpConnect();
            }

            //显示公告
            if (uiInterFace.sysMessage.bShowNotice) {
                uiInterFace.sysMessage.updateNotice();
            }
            //引导
            if (uiInterFace.sysMessage.bShowGuide) {
                uiInterFace.sysMessage.updateGuide();
            }
            //查看物品 
            if (uiInterFace.sysMessage.bShowCheckItem) {
                uiInterFace.sysMessage.updateCheckItem();
            }
            //显示物品的选择/插入界面
            if (this.uiPackage.bShowBAG && !MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide) {
                this.uiPackage.updatePackage();
            }

            //#if NOKIA_S60V5
             if (MainLogic.getInstance().uiInterFace.byShowPointPlace > -1 && this.byGameState != Constant.GAME_UI_ROAM) {
                 MainLogic.getInstance().uiInterFace.byShowPointPlace = -1;
             }
            //#endif
            if (MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide) {
                updateUIGuide();
            } else {
                //根据游戏状态更新游戏数据
                switch (MainLogic.byGameState) {
                    case Constant.GAME_UI_LOADING:
                        uiInterFace.updateLoading();
                        break;
                    case Constant.GAME_UI_PACKAGE:
                        uiPackage.updatePackage();
                        break;
                    case Constant.GAME_UI_EQUIPMENT:
                        uiPackage.updateEquip();
                        break;
                    case Constant.GAME_UI_SKILL:
                        uiEquipment.updateSkill();
                        break;
                    case Constant.GAME_UI_EXCHANGE:
                        uiEquipment.updateExchange();
                        break;
                    case Constant.GAME_UI_GAMESET:
                        uiEquipment.updateGameset();
                        break;
                    case Constant.GAME_UI_OPEN_SCREEN:
                        uiLogin.updateOpenScreen();
                        break;
                    case Constant.GAME_UI_CHAT:
                        uiEquipment.updateChat();
                        break;
                    case Constant.GAME_UI_CHAT_SECOND:
                        uiEquipment.updateChatSecond();
                        break;
                    case Constant.GAME_UI_SMILE:
                        if (uiEquipment != null) {
                            uiEquipment.updateSmile();
                        }
                        break;
                    case Constant.GAME_UI_CHAT_SET:
                        if (uiEquipment != null) {
                            uiEquipment.updateChatSet();
                        }
                        break;
                    case Constant.GAME_UI_CONNECTION_AGAIN:
                        uiEquipment.updateConnecAgain();
                        break;
                    case Constant.GAME_UI_TONG_SKILL:
                        uiInterFace.tong.updateTongSkill();
                        break;
                    case Constant.GAME_UI_TONG_MENU:
                        uiInterFace.tong.updateTongMenu();
                        break;
                    case Constant.GAME_UI_NEAR_PLAYER_LIST:
                        uiInterFace.updateNearPlayerList();
                        break;
                    case Constant.GAME_UI_APPLY_TONG_LIST:
                        uiInterFace.tong.updateApplyTongList();
                        break;
                    case Constant.GAME_UI_HELP:
                        uiLogin.updateHelp();
                        break;
                    case Constant.GAME_UI_ABOUT:
                        uiLogin.updateAbout();
                        break;
                    case Constant.GAME_UI_SET:
                        uiLogin.updateSet();
                        break;
                    case Constant.GAME_UI_UPDATE:
                        uiLogin.updateUpdate();
                        break;
                    case Constant.GAME_UI_QUESTION:
                        uiInterFace.updateQuestion();
                        break;
                    case Constant.GAME_UI_PUNCH_CLOCK:
                        uiInterFace.updatePunchClock();
                        break;

                    case Constant.GAME_UI_BUFFER_LIST:
                        uiInterFace.property.updateBufferList();
                        break;
                    //#if NOKIA_S60V5 || NOKIA_S40V3 || MOT0 || K790
                     case Constant.GAME_UI_ACCEPT_TASK:
                         uiInterFace.npcTalk.updateTask();
                         break;
                     case Constant.GAME_UI_TRANSFER_LIST:
                         uiInterFace.npcTalk.updateTransferList();
                         break;
                    //#endif
                    case Constant.GAME_UI_ROAM_MENU:
                    case Constant.GAME_UI_NPC_TALK:
                    //#if NOKIA_S60V5 || NOKIA_S40V3 || MOT0 || K790
                    //#else
//#                    case Constant.GAME_UI_ACCEPT_TASK:
//#                    case Constant.GAME_UI_TRANSFER_LIST:
                    //#endif
                    case Constant.GAME_UI_TEAM_ANSWER:
                    case Constant.GAME_UI_ROAM:
                    case Constant.GAME_UI_TONG_BUILDING:
                    case Constant.GAME_UI_GAMESET_QUICKEYS:
                    case Constant.GAME_UI_REVIVE:
                    case Constant.GAME_UI_EQUIP_REPAIR:
                    case Constant.GAME_UI_CONTEST_ANSWER:
                    case Constant.GAME_UI_TASK_AUTO_FIND_PATH:
                        if (!this.bClientIsReady) {
                            return;
                        }
                        switch (this.byGameState) {
                            case Constant.GAME_UI_ROAM_MENU:
                                uiInterFace.updateRoamMenu();
                                break;
                            case Constant.GAME_UI_NPC_TALK:
                                uiInterFace.npcTalk.updateNPCTalk();
//                            return;
                                break;
                            //#if NOKIA_S60V5 || NOKIA_S40V3 || MOT0 || K790
                            //#else
//#                            case Constant.GAME_UI_ACCEPT_TASK:
//#                                uiInterFace.npcTalk.updateTask();
//#                                break;
//#                            case Constant.GAME_UI_TRANSFER_LIST:
//#                                uiInterFace.npcTalk.updateTransferList();
//#                                break;
                            //#endif
                            case Constant.GAME_UI_TEAM_ANSWER:
                                uiInterFace.team.updateTeamAnswer();
                                break;
                            case Constant.GAME_UI_TONG_BUILDING:
                                uiInterFace.tong.updateTongBuilding();
                                break;
                            case Constant.GAME_UI_GAMESET_QUICKEYS:
                                UiInterFace.gameSet.updateQuickSet();
                                break;
                            case Constant.GAME_UI_REVIVE:
                                uiInterFace.updateRevive();
                                break;
                            case Constant.GAME_UI_EQUIP_REPAIR:
                                uiInterFace.npcTalk.updateRepairEquip();
                                break;
                            case Constant.GAME_UI_CONTEST_ANSWER:
                                uiInterFace.updateContest();
                                break;
                            case Constant.GAME_UI_TASK_AUTO_FIND_PATH:
                                uiInterFace.npcTalk.updateTaskAutoFindPath();
                                break;
                        }
                        if (!bSendOnScreen) {
                            MainLogic.getInstance().bSendOnScreen = true;
                            GameBean.SCREEN_TYPE = 1;
                            MainLogic.getInstance().send(Constant.MSG_NET_CMD_OPT_ON_SCREEN, Constant.SOCKET_MSG_TYPE_LOGIC);
                        }
                        if (!blLogined) {
                            break;
                        }
                        if (bCanStartGuide && MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] < 0
                                && MainLogic.getInstance().uiInterFace.sysMessage.saveStateGuide < 0) {
                            bCanStartGuide = false;
                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 0, 0);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 0;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 0;
                            MainLogic.getInstance().uiInterFace.sysMessage.saveGuide(0);
                        }

                        //如果是快速注册用户每隔5分钟提示用户注册
                        if (GameBean.BL_CMD_QUICK_REGISTER && (System.currentTimeMillis() - GameBean.L_QUICK_REGISTER_START_TIME >= 120000)) {
                            GameBean.BL_CMD_QUICK_REGISTER = false;
                            this.pushState(Constant.GAME_UI_CHANGE_PASSWD, true);
//                            if (!MainLogic.getInstance().uiInterFace.sysMessage.bShowPopUpMessage && (System.currentTimeMillis() - GameBean.L_QUICK_REGISTER_START_TIME >= 300000)) {
//                                GameBean.I_SYSTEM_MESSAGE_TYPE = 1;
//                                String note = MainLogic.getInstance().gamePlayer.sPlayerName + ",您是快速注册玩家，为了保证您的切身利益及帐号密码安全，强烈建议您更换密码，是否现在更换？";
//                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("特别提示", note);
//                                GameBean.L_QUICK_REGISTER_START_TIME = System.currentTimeMillis();
//                                note = null;
//                            }
                        }
                        if (!Constant.b_QUICK_DEBUG_GAME_UI) {
                            uiInterFace.updateRoamUI();
                            //显示漫游界面下的菜单界面
                            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)) {
                                //#if NOKIA_S60V5
                                 Tools.openRoamMenu(false, (byte) 1, (byte) 0, 6);
                                //#else
//#                                Tools.openRoamMenu(false, (byte) 1, (byte) 0, 5);
                                //#endif
                            } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {
                                Tools.openRoamMenu(false, (byte) 2, (byte) 0, 2);
                            }
                            //如果
//                        if(QuickOption.iShowQuickNote != -1)
//                        {
//                        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POUND, false)) {
//                             QuickOption.setQuickNote(true);
//                        }
//                        }
//                            gameMap.initMapData(new DataInputStream(this.getClass().getResourceAsStream("/xinshoucun 1 0.ter")),false);
////                            NetManager.getInstance().closeConnect();
////                            NetManager.getNewInstance().startNetManager();
////                            System.out.println("333333333333333333333333333333333333333333");
////                            MainLogic.getInstance().gamePlayer.addAutoRunTagPath(1, 0, 70, 1615);
////                            MainLogic.getInstance().gamePlayer.startAutoMovePath();
////                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("引导", MainLogic.getInstance().uiInterFace.strNewPlayer[2]);
////                            GameBean.b_WAIT_NET_MSG_BACK = true;
////                            GameBean.BY_STATE_NEWPLAYER = 2;
////                            MainLogic.getInstance().send(Constant.MSG_NET_CMD_OPEN_ATTR_POINT, Constant.SOCKET_MSG_TYPE_LOGIC);
//                        }

                            /*****************************临时测试添加********************************/
//                            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_9, false)) {
////                            GameBean.BY_QUESTION = 1;
////                            send(Constant.MSG_NET_CMD_QUESTION_INFO, Constant.SOCKET_MSG_TYPE_LOGIC);
//                                if (MainLogic.getInstance().gamePlayer.iPlayerLevel < 30) {
//                                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "只有30级及以上玩家才能开启离线挂机功能!", (byte) 1, (byte) -1);
//                                } else {
//                                    MainLogic.getInstance().send(Constant.MSG_NET_CMD_HANGUP_START, Constant.SOCKET_MSG_TYPE_LOGIC);
//                                }
//                            } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_8, false)) {
//                                pushState(Constant.GAME_UI_PUNCH_CLOCK, true);
//                            } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_7, false)) {
//                                send(Constant.MSG_NET_CMD_TONG_LIST, Constant.SOCKET_MSG_TYPE_LOGIC);
//                            } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_7, false)) {
//                            }
                            /**********************end********************************/
                            //
//                        gameNpcArray.shNpcTypes[i] == Constant.NPC_TYPE_CANNOTATTACK
                            ////////////////////////////
                            //更新伤害数字显示
                            if (this.damage.getSize() > 0) {
                                this.damage.updateDamage();
                            }
                            //玩家操作逻辑
                            if (gamePlayer.byPlayerState != Constant.PLAYER_STATE_DIE) {
                                gamePlayer.byPlayerUpdateState = Constant.PLAYER_STATE_STAND;
                            }
                            //#if NOKIA_S60V5
                             if (QuickOption.strQuickNote != null) {
                                 if (MainCanvas.pointerPressedLogic(QuickOption.POS_X2 - Constant.FONT_SMALL.stringWidth(QuickOption.strQuickNote) - 12, QuickOption.POS_Y2 + 45, Constant.FONT_SMALL.stringWidth(QuickOption.strQuickNote) + 12, 30, false)) {
                                     if (QuickOption.blShowQuickNote) {
                                         GameBean.BY_PRE_GAME_UI_STATE = -1;
                                         pushState(Constant.GAME_UI_QUICK_OPTION, true);
                                         QuickOption.setQuickNote(false);
                                     }
                                 }
                             }
                            //#endif
                            //#if NOKIA_S60V5
                             if (this.byGameState == Constant.GAME_UI_ROAM
                                     && !MainLogic.getInstance().uiInterFace.sysMessage.bShowPopUpMessage
                                     && !MainLogic.getInstance().uiInterFace.sysMessage.bShowNotice
                                     && !uiInterFace.sysMessage.bShowGuide
                                     && (MainCanvas.pointerPressedLogic(0, 0, Constant.SCREEN_WIDTH, MainCanvas.touch_y - 160, false)
                                     || MainCanvas.pointerPressedLogic(164, MainCanvas.touch_y - 160, Constant.SCREEN_WIDTH - 164, 160, false))) {
                                 byte bcanNotGo = this.gameMap.canNotGo(((MainLogic.gameMap.iMapWorldOffsetX + MainCanvas.getPointerLogicX()) >> 4) << 4, ((MainLogic.gameMap.iMapWorldOffsetY + MainCanvas.getPointerLogicY()) >> 4) << 4, (byte) 1);
                                 if (bcanNotGo == 0 || bcanNotGo == 2) {
                                     if (gamePlayer.iPlayerSkillStartTime[0] == -1) {
                                         if (gamePlayer.byPlayerState == Constant.PLAYER_STATE_AUTO_RUN) {
                                             if ((((this.uiInterFace.iPointX >> 4) - (gamePlayer.iTargetAutoX >> 4)) < 2
                                                     && ((this.uiInterFace.iPointX >> 4) - (gamePlayer.iTargetAutoX >> 4)) > -2)
                                                     && (((this.uiInterFace.iPointY >> 4) - (gamePlayer.iTargetAutoY >> 4))) < 2
                                                     && ((this.uiInterFace.iPointY >> 4) - (gamePlayer.iTargetAutoY >> 4)) > -2) {
                                                 this.uiInterFace.startAutoRunPoint(((MainLogic.gameMap.iMapWorldOffsetX + MainCanvas.getPointerLogicX()) >> 4) << 4,
                                                         ((MainLogic.gameMap.iMapWorldOffsetY + MainCanvas.getPointerLogicY()) >> 4) << 4);
 //                                                System.out.println("000000000000000000000000000000000000");
                                                 return;
                                             } else {
 //                                                System.out.println("888888888888888888888888888888888888888888888888888888888888888");
                                                 gamePlayer.stopAutoRun(false, false);
                                                 this.clearLockedObj(0, true);
                                             }
                                         }
                                         //绘制目标点的标记
 
                                         this.uiInterFace.startAutoRunPoint(((MainLogic.gameMap.iMapWorldOffsetX + MainCanvas.getPointerLogicX()) >> 4) << 4,
                                                 ((MainLogic.gameMap.iMapWorldOffsetY + MainCanvas.getPointerLogicY()) >> 4) << 4);
                                         if (this.iLockedObjNumber[0][0] == -1) {
                                             gamePlayer.runPathFinderForMission(MainLogic.getInstance().uiInterFace.sRoamMapKeys,
                                                     MainLogic.gameMap.iMapWorldOffsetX + MainCanvas.getPointerLogicX(),
                                                     MainLogic.gameMap.iMapWorldOffsetY + MainCanvas.getPointerLogicY());
                                             MainLogic.first_touchNpc_fire = true;
 //                                        this.clearLockedObj(0, true);
 //                                            System.out.println("aaaaaaaaaa");
                                         } else {
                                             if (Tools.getDistance(gamePlayer.iPlayerX, gamePlayer.iPlayerY,
                                                     ((MainLogic.gameMap.iMapWorldOffsetX + MainCanvas.getPointerLogicX()) >> 4) << 4,
                                                     ((MainLogic.gameMap.iMapWorldOffsetY + MainCanvas.getPointerLogicY()) >> 4) << 4)
                                                     > gamePlayer.iPlayerSkillDistance[0] * gamePlayer.iPlayerSkillDistance[0]) {
                                                 gamePlayer.runPathFinderForMission(MainLogic.getInstance().uiInterFace.sRoamMapKeys,
                                                         MainLogic.gameMap.iMapWorldOffsetX + MainCanvas.getPointerLogicX(),
                                                         MainLogic.gameMap.iMapWorldOffsetY + MainCanvas.getPointerLogicY());
                                                 MainLogic.first_touchNpc_fire = true;
                                                 this.clearLockedObj(0, true);
 //                                                System.out.println("sssssssssssssssssssssssssss");
                                             } else {
                                                 oncetouch = true;
                                                 gamePlayer.playerUseSkill(0, true, true);
                                                 oncetouch = false;
 //                                                System.out.println("ddddddddddddddddd");
                                             }
                                         }
                                     }
                                 }
                             }
                             if (istouchNpc_fire) {
                                 if (touchLockedObj_npcid[0] != -1
                                         //                                        && touchLockedObj_npcid[7] == Constant.NPC_TYPE_CANATTACK
                                         && touchLockedObj_npcid[6] != 3
                                         && touchLockedObj_npcid[6] != 4) {
 //                                    if (touchLockedObj_npcid[2] >= this.gamePlayer.iPlayerX - iLockedPartW
 //                                            && touchLockedObj_npcid[2] <= this.gamePlayer.iPlayerX + iLockedPartW
 //                                            && (touchLockedObj_npcid[3] >= this.gamePlayer.iPlayerY - iLockedPartH
 //                                            && touchLockedObj_npcid[3] <= this.gamePlayer.iPlayerY + iLockedPartH)) {
                                     if (this.iLockedObjNumber[0][0] == -1) {
                                         this.iLockedObjNumber[0][0] = touchLockedObj_npcid[0];
                                         this.iLockedObjNumber[0][1] = touchLockedObj_npcid[1];
                                         this.iLockedObjNumber[0][2] = touchLockedObj_npcid[2];
                                         this.iLockedObjNumber[0][3] = touchLockedObj_npcid[3];
                                         this.iLockedObjNumber[0][4] = touchLockedObj_npcid[4];
                                         this.iLockedObjNumber[0][5] = touchLockedObj_npcid[5];
                                         if (this.iLockedObjNumber[0][4] == Constant.LOCKED_TYPE_OTHERPLAYER) {
                                             GameBean.L_PLAYER_ID = MainLogic.iLockedObjNumber[0][0];
 //                                            System.out.println("111111111111111111111111111111");
                                             this.send(Constant.MSG_NET_CMD_OTHER_PLAYER_INFO, Constant.SOCKET_MSG_TYPE_LOGIC);
                                             send(Constant.MSG_NET_BUFF_OPT, Constant.SOCKET_MSG_TYPE_LOGIC);
                                         } else if (this.iLockedObjNumber[0][4] == Constant.LOCKED_TYPE_NPC) {
                                             GameBean.L_PLAYER_ID = MainLogic.iLockedObjNumber[0][0];
 //                                            System.out.println("22222222222222222222222222");
                                             send(Constant.MSG_NET_CMD_NPC_INFO, Constant.SOCKET_MSG_TYPE_LOGIC);
                                             if (touchLockedObj_npcid[7] == Constant.NPC_TYPE_CANATTACK) {
                                                 send(Constant.MSG_NET_BUFF_OPT, Constant.SOCKET_MSG_TYPE_LOGIC);
                                             }
                                         }
                                         oncetouch = true;
                                         gamePlayer.playerUseSkill(0, true, true);
 //                                        System.out.println("333333333333333333333");
                                         oncetouch = false;
                                         istouchNpc_fire = false;
                                     } else if (this.iLockedObjNumber[0][0] != -1 && this.iLockedObjNumber[0][0] != touchLockedObj_npcid[0]) {
                                         this.iLockedObjNumber[0][0] = touchLockedObj_npcid[0];
                                         this.iLockedObjNumber[0][1] = touchLockedObj_npcid[1];
                                         this.iLockedObjNumber[0][2] = touchLockedObj_npcid[2];
                                         this.iLockedObjNumber[0][3] = touchLockedObj_npcid[3];
                                         this.iLockedObjNumber[0][4] = touchLockedObj_npcid[4];
                                         this.iLockedObjNumber[0][5] = touchLockedObj_npcid[5];
                                         if (this.iLockedObjNumber[0][4] == Constant.LOCKED_TYPE_OTHERPLAYER) {
                                             GameBean.L_PLAYER_ID = MainLogic.iLockedObjNumber[0][0];
 //                                            System.out.println("4444444444444444444444444");
                                             this.send(Constant.MSG_NET_CMD_OTHER_PLAYER_INFO, Constant.SOCKET_MSG_TYPE_LOGIC);
                                             send(Constant.MSG_NET_BUFF_OPT, Constant.SOCKET_MSG_TYPE_LOGIC);
                                         } else if (this.iLockedObjNumber[0][4] == Constant.LOCKED_TYPE_NPC) {
                                             GameBean.L_PLAYER_ID = MainLogic.iLockedObjNumber[0][0];
 //                                            System.out.println("5555555555555555");
                                             send(Constant.MSG_NET_CMD_NPC_INFO, Constant.SOCKET_MSG_TYPE_LOGIC);
                                             if (touchLockedObj_npcid[7] == Constant.NPC_TYPE_CANATTACK) {
                                                 send(Constant.MSG_NET_BUFF_OPT, Constant.SOCKET_MSG_TYPE_LOGIC);
                                             }
                                         }
                                         oncetouch = true;
                                         gamePlayer.playerUseSkill(0, true, true);
                                         oncetouch = false;
                                         istouchNpc_fire = false;
 //                                        System.out.println("6666666666666666666666666666");
                                     }
 //                                        else {
 //                                            this.playerFightLogic((byte) 0, false);
 //                                            istouchNpc_fire = false;
 //                                            System.out.println("77777777777777777777777777777777777777777777777777");
 //                                        }
 //                                    }
                                 }
                             }
                            //#endif
//                        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, true)) {
//                            this.clearLockedObj(0, true);
//                            MainLogic.getInstance().gamePlayer.byPlayerUpdateState = Constant.PLAYER_STATE_STAND;
//                        }
//                            else
                            {
                                //左右前后行走
                                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, true)) {
                                    if (!this.blCursorTurnGame) {
                                        this.gamePlayer.byPlayerUpdateState = Constant.PLAYER_STATE_RUN;
                                        this.gamePlayer.byPlayerUpdateDirection = Constant.PLAYER_DIRECTION_UP;
                                        //有移动就解除对NPC的锁定
                                        if (this.iLockedObjNumber[0][0] != -1) {
                                            if (this.iLockedObjNumber[0][4] == Constant.LOCKED_TYPE_NPC) {
                                                if (gameNpcArray.shNpcTypes[(short) iLockedObjNumber[0][1]] == Constant.NPC_TYPE_CANNOTATTACK) {
                                                    this.clearLockedObj(0, true);
                                                }
                                            }
                                        }
                                    }
                                    this.blCursorTurnGame = false;
                                } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, true)) {
                                    if (!this.blCursorTurnGame) {
                                        this.gamePlayer.byPlayerUpdateState = Constant.PLAYER_STATE_RUN;
                                        this.gamePlayer.byPlayerUpdateDirection = Constant.PLAYER_DIRECTION_DOWN;
                                        //有移动就解除对NPC的锁定
                                        if (this.iLockedObjNumber[0][0] != -1) {
                                            if (this.iLockedObjNumber[0][4] == Constant.LOCKED_TYPE_NPC) {
                                                if (gameNpcArray.shNpcTypes[(short) iLockedObjNumber[0][1]] == Constant.NPC_TYPE_CANNOTATTACK) {
                                                    this.clearLockedObj(0, true);
                                                }
                                            }
                                        }
                                    }
                                    this.blCursorTurnGame = false;
                                } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, true)) {
                                    if (!this.blCursorTurnGame) {
                                        this.gamePlayer.byPlayerUpdateState = Constant.PLAYER_STATE_RUN;
                                        this.gamePlayer.byPlayerUpdateDirection = Constant.PLAYER_DIRECTION_LEFT;
                                        //有移动就解除对NPC的锁定
                                        if (this.iLockedObjNumber[0][0] != -1) {
                                            if (this.iLockedObjNumber[0][4] == Constant.LOCKED_TYPE_NPC) {
                                                if (gameNpcArray.shNpcTypes[(short) iLockedObjNumber[0][1]] == Constant.NPC_TYPE_CANNOTATTACK) {
                                                    this.clearLockedObj(0, true);
                                                }
                                            }
                                        }
                                    }
                                    this.blCursorTurnGame = false;
                                } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, true)) {
                                    if (!this.blCursorTurnGame) {
                                        this.gamePlayer.byPlayerUpdateState = Constant.PLAYER_STATE_RUN;
                                        this.gamePlayer.byPlayerUpdateDirection = Constant.PLAYER_DIRECTION_RIGHT;
                                        //有移动就解除对NPC的锁定
                                        if (this.iLockedObjNumber[0][0] != -1) {
                                            if (this.iLockedObjNumber[0][4] == Constant.LOCKED_TYPE_NPC) {
                                                if (gameNpcArray.shNpcTypes[(short) iLockedObjNumber[0][1]] == Constant.NPC_TYPE_CANNOTATTACK) {
                                                    this.clearLockedObj(0, true);
                                                }
                                            }
                                        }
                                    }
                                    this.blCursorTurnGame = false;
                                }
                                //战斗
                                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {
                                    clickFire();
                                } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_1, false)) {
                                    this.playerFightLogic((byte) 0, true);//
                                } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_2, false)) {
                                    this.playerFightLogic((byte) 1, true);//
                                } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_3, false)) {
                                    this.playerFightLogic((byte) 2, true);//
                                } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_4, false)) {
                                    this.playerFightLogic((byte) 3, true);//
                                } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_5, false)) {
                                    this.playerFightLogic((byte) 4, true);//
                                } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_6, false)) {
                                    this.playerFightLogic((byte) 5, true);//
                                } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_7, false)) {
                                    this.playerFightLogic((byte) 6, true);//
                                } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_8, false)) {
                                    this.playerFightLogic((byte) 7, true);//
                                } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_9, false)) {
                                    this.playerFightLogic((byte) 8, true);//
                                } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POUND, false)) {
                                    if (QuickOption.blShowQuickNote) {
                                        GameBean.BY_PRE_GAME_UI_STATE = -1;
                                        pushState(Constant.GAME_UI_QUICK_OPTION, true);
                                        QuickOption.setQuickNote(false);
                                    } else {
                                        GameBean.BY_PRE_GAME_UI_STATE = -1;
                                        this.uiInterFace.npcTalk.openTaskList();
                                    }
                                } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_STAR, false)) {
                                    MainLogic.getInstance().pushState(Constant.GAME_UI_CHAT, true);
                                }
                            }
                            //挂机
                            if (GameBean.BL_PLAYER_HANGUP) {
                                this.gamePlayer.playerHangUpLogic();
                            }
                            //更新逻辑
                            this.gamePlayer.updateRole();
                            this.gameNpcArray.updateNpc();
                            this.gameOtherplayerArray.updateOther();
                            //更新锁定
                            this.updateLockedObj();
//                         SkillBuffManager.updateBuffTable();
                            //更新buff
                            SkillBuffManager.updateBuffTable();
                        }
                        break;
                    case Constant.GAME_UI_TEAM_INFO:
                        uiInterFace.team.updateTeamInfo();
                        break;
                    case Constant.GAME_UI_VIEW_OTHER_PLAYER:
//                    uiInterFace.updateOtherPlayerInfo();
                        uiInterFace.updateLockPlayer();
                        break;
                    case Constant.GAME_UI_LOOK_OTHERPLAYER://查看其他玩家
                        uiInterFace.updateOtherPlayerLooked();
                        break;
                    //游戏UI界面
                    case Constant.GAME_UI_LOGO:
                        uiLogin.updateLogo();
                        break;
                    case Constant.GAME_UI_OPTION_LIST:
                        uiLogin.updateOptionList();
                        break;
                    case Constant.GAME_UI_OVER:
                        uiLogin.updateOver();
                        break;
                    case Constant.GAME_UI_LOGIN:
                        uiLogin.updateLogin();
                        break;
                    case Constant.GAME_UI_SERVER_LIST:
                        uiLogin.updateServerList();
                        break;
                    case Constant.GAME_UI_CREATE_ROLE:
                        uiLogin.updateCreateRole();
                        break;
                    case Constant.GAME_UI_TASK_LIST:
                        uiInterFace.npcTalk.updateTaskList();
                        break;
                    case Constant.GAME_UI_CREATE_TONG:
                        uiInterFace.tong.updateCreateTong();
                        break;
                    case Constant.GAME_UI_TONG_LIST:
                        uiInterFace.tong.updateTongList();
                        break;
                    case Constant.GAME_UI_TONG_MEMBER_LIST:
                        uiInterFace.tong.updateTongMemberList();
                        break;
                    case Constant.GAME_UI_TONG_INFO:
                        uiInterFace.tong.updateTongInfo();
                        break;
                    case Constant.GAME_UI_PET_COMPOSE:
                        MainLogic.getInstance().uiInterFace.pet.updatePetCompose();
                        break;
                    case Constant.GAME_UI_PET_EQUIP:
                        MainLogic.getInstance().uiInterFace.pet.updatePetEquip();
                        break;
                    case Constant.GAME_UI_SEND_EMAIL:
                        if (uiEquipment != null) {
                            uiEquipment.updateSendEmail();
                        }
                        break;
                    case Constant.GAME_UI_RECEIVE_EMAIL:
                        if (uiEquipment != null) {
                            uiEquipment.updateReceiveEmail();
                        }
                        break;
                    case Constant.GAME_UI_OPERATION_EMAIL:
                        if (uiEquipment != null) {
                            uiEquipment.updateOperationEmail();
                        }
                        break;
                    case Constant.GAME_UI_VIEW_EMAIL://查看邮件
                        if (uiEquipment != null) {
                            uiEquipment.updateViewEmail();
                        }
                        break;
                    case Constant.GAME_UI_MERIDIANS:
                        if (uiEquipment != null) {
                            uiEquipment.updateMeridians();
                        }
                        break;
                    case Constant.GAME_UI_MAP_WORLD:
                        if (uiEquipment != null) {
                            uiEquipment.updateMapWorld();
                        }
                        break;
                    case Constant.GAME_UI_NOTICE_LIST:
                        uiEquipment.updateNoticeList();
                        break;
                    case Constant.GAME_UI_ITEMS_COMPOSE:
                        //物品合成
                        this.uiInterFace.equipment.updateItemsCompose();
                        break;

                    case Constant.GAME_UI_ITEMS_DECOMPOSE:
                        //物品分解
                        this.uiInterFace.equipment.updateItemsDecompose();
                        break;
                    case Constant.GAME_UI_ITEMS_STRENGTHEN:
                        // //物品强化
                        this.uiInterFace.equipment.updateItemsStrengthen();
                        break;
                    case Constant.GAME_UI_EQUIP_OPERATION:
                        //物品打孔镶嵌拆分
                        this.uiInterFace.equipment.updateEquipOperation();
                        break;
                    //好友列表
                    case Constant.GAME_UI_FRIEND_LIST:
                        uiInterFace.friend.updateFriendList();
                        break;
                    case Constant.GAME_UI_STORE_SOLD:
                        break;
                    case Constant.GAME_UI_STORE_BUY:
                        UiInterFace.store.updateStoreBuy();
                        break;
                    case Constant.GAME_UI_TRADE:
                        UiInterFace.store.updateTrade();
                        break;
                    case Constant.GAME_UI_TRADE_ANSWER:
                        UiInterFace.store.updateTradeAnswer();
                        break;
                    case Constant.GAME_UI_WAREHOUSE:
                        UiInterFace.store.updateWareHouse();
                        break;
                    case Constant.GAME_UI_PLAYER_INFO:
                        UiInterFace.property.updatePlayerInfo();
                        break;
                    case Constant.GAME_UI_PROPERTY_ADD_POINT:
                        UiInterFace.property.updatePropertyAddPoint();
                        break;
                    case Constant.GAME_UI_PET_POWER_STRENGTHEN:
                        MainLogic.getInstance().uiInterFace.pet.updatePetPowerStrength();
                        break;
                    case Constant.GAME_UI_INGOT_STORE:
                        uiInterFace.store.updateIngotStore();
                        break;
                    case Constant.GAME_UI_WAGE_STORE:
                        uiInterFace.store.updateWageStore();
                        break;
                    case Constant.GAME_UI_INGOT_RECORD:
                        uiInterFace.store.updateIngotRecord();
                        break;
                    case Constant.GAME_UI_FUNC_DESC:
                        uiInterFace.npcTalk.updateFuncDesc();
                        break;
                    case Constant.GAME_UI_FUNC_SETTING:
                        uiInterFace.gameSet.updateFuncSetting();
                        break;
                    case Constant.GAME_UI_QUICK_OPTION:
                        uiInterFace.quickOption.updateQuickOption();
                        break;
                    case Constant.GAME_UI_PLAYER_TOP:
                        uiInterFace.property.updatePlayerTop();
                        break;
                    case Constant.GAME_UI_PLAYER_STALL:
                        uiInterFace.store.updatePlayerStall();
                        break;
                    case Constant.GAME_UI_HANGUP:
                        uiInterFace.property.updateHangUp();
                        break;
                    case Constant.GAME_UI_CHANGE_PASSWD:
                        uiInterFace.updateChangePasswd();
                        break;
                    case Constant.GAME_UI_NETWORK_SELECT:
                        uiLogin.updateNetWorkSelect();
                        break;
                    case Constant.GAME_UI_CHARGE:
                        uiInterFace.gameSet.updateCharge();
                        break;
                    case Constant.GAME_UI_CHARGE_LIST:
                        uiInterFace.gameSet.updateChargeList();
                        break;
                }
            }
        } catch (Exception e) {
            if (Constant.DEBUG) {
                e.printStackTrace();
            }
            MainCanvas.addLog(e.toString());
        }
    }

    /**
     * 发送调度方法其它类调用都通过此方法中转,发送消息
     * @param msgid  消息ID
     * @param msgtype  消息类型
     */
    public void send(int msgid, byte msgtype) {
        MainLogic.netController.send(msgid, msgtype);
    }

    public void clickFire() {
        if (this.iLockedObjNumber[0][4] == Constant.LOCKED_TYPE_OTHERPLAYER) {
            Tools.printLog("地图KEY：" + uiInterFace.sRoamMapKeys);
            if (uiInterFace.sRoamMapKeys.equals("10101")
                    || uiInterFace.sRoamMapKeys.equals("10201")) {
                playerFightLogic((byte) 99, true);
            } else {
                Tools.printLog("切磋状态：" + gamePlayer.blPkState);
                if (gamePlayer.blPkState) {
                    this.playerFightLogic((byte) 99, true);
                } else {
                    if (gamePlayer.byPlayerBigState == Constant.PLAYER_BIG_STATE_FIGHT) {
                        if (gamePlayer.iPlayerLevel < 20) {
                            MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 5, "你涉世未深，不要暗下毒手!");
                        } else if (iLockedObjInfor[0] < 20) {
                            MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 5, "对方涉世未深，怎忍心下此毒手!");
                        } else if (gamePlayer.bPkState == 0) {
                            uiInterFace.sysMessage.showMessage("提示", "您尚未开启PK状态!", (byte) 1, (byte) -1);
                        } else {
                            this.playerFightLogic((byte) 99, true);
                        }
                    } else {
                        this.playerFightLogic((byte) 99, false);
                    }
                }
            }
        } else {
            this.playerFightLogic((byte) 99, false);
        }
    }
    //锁定发送
    public boolean blLockedObj = false;

    public void playerFightLogic(byte actIndex, boolean blattack) {
        //玩家死亡直接返回不能操作
        if (this.gamePlayer.byPlayerState == Constant.PLAYER_STATE_DIE) {
            return;
        }
        if (actIndex != -1) {
            int type = getQuickSetType(actIndex);
            int index = (actIndex == 99) ? 0 : getQuickSetID(actIndex);
            if (GameBean.BL_PLAYER_HANGUP)//挂机得到可用技能的index
            {
                if (type == 3 && getQuickSetFuncID(actIndex) == Constant.FUNC_ID_HANG_UP) {
                    GameSet.runFunc(Constant.FUNC_ID_HANG_UP);
                    type = 0;
                    index = Property.getCanUseSkillIndex();
                } else {
                    type = 0;
                    index = Property.getCanUseSkillIndex();
                }

            }
            //技能使用目标类型规则判断
//            if (Player.bySkillType[index] == Constant.SKILL_USE_TYPE_TEAM) {
//                if (this.iLockedObjNumber[0][4] == Constant.LOCKED_TYPE_OTHERPLAYER && UiInterFace.team.getMemberPos(this.iLockedObjNumber[0][1]) != -1) {
//                } else {
//                }
//            }
            //技能蓝是否足够判断
            //技能攻击距离是否足够判断
            if (type == 2) {//物品快捷键
                if (uiInterFace.gameSet.quickSetTime[actIndex][0] == 0) {//说明物品可用
                    if (Integer.parseInt(UiInterFace.gameSet.QuickSet[actIndex][6]) > 0) {
                        GameBean.L_CMD_GOODS_SLOTKEY = Long.parseLong(UiInterFace.gameSet.QuickSet[actIndex][3]);
                        GameBean.BY_CMD_COLUMN_TYPE = Constant.ITEM_COLUMN_TYPE_COMMON;
                        Constant.ITEM_OPERATION_TYPE_RECORD = Constant.ITEM_OPERATION_TYPE_GAMESET;
                        MainLogic.getInstance().send(Constant.MSG_NET_CMD_USE_ITEM, Constant.SOCKET_MSG_TYPE_LOGIC);
                    }
                } else {
                    MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 5, "物品尚未冷却！");
                    Constant.ITEM_OPERATION_TYPE_RECORD = -1;
                }
            } else if (type == 3) {
                GameSet.runFunc(getQuickSetFuncID(actIndex));
            } else {//技能快捷键
                //增减益技能如果没有 锁定目标直接释放给自己
                if (actIndex != -1) {
                    if (MainLogic.getInstance().gamePlayer.blCanUseSkill) {
                        //如果该技能冷却时间未到返回
//                            int index = (actIndex == 99) ? 0 : getQuickSetID(actIndex);
                        if (index != -1 && Player.byPlayerSkillType != null && (Player.byPlayerSkillType[index] == Constant.SKILL_TYPE_PLAYERSELF || (Player.byPlayerSkillType[index] == Constant.SKILL_TYPE_AREA && Player.bySkillType[index] == Constant.SKILL_USE_TYPE_TEAM))) {
//                    boolean blIsJobSkill = SkillManager.isPlayerJobSkillType(Integer.parseInt(Player.strPlayerSkill[index]));
//                            if ((byte) MainLogic.iLockedObjNumber[0][1] != Constant.NPC_TYPE_CANNOTATTACK) {
                            gamePlayer.playerUseSkill(index, false, true);
//                            }
                            return;
                        }
                    } else {
                        MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 5, "混乱状态下不能使用技能！");
                        Constant.ITEM_OPERATION_TYPE_RECORD = -1;
                        return;
                    }
                }
                if (iLockedObjNumber[0][1] == -1) {
                    if (actIndex != -1) {
                        LockedObj_index = 0;
                        lockedObj(this.gamePlayer.iPlayerX, this.gamePlayer.iPlayerY);
                    }
                } //有锁定目标变攻击
                else if (iLockedObjNumber[0][1] != -1) {
                    //任务 npc
                    if (this.iLockedObjNumber[0][4] == Constant.LOCKED_TYPE_NPC) {
                        if (gameNpcArray.shNpcTypes[(int) this.iLockedObjNumber[0][1]] == Constant.NPC_TYPE_CANNOTATTACK) {
                            //发送NPC请求信息
                            if (!bSendLockedNpcInfo) {
                                bSendLockedNpcInfo = true;
                                //MainLogic.netController.send(Constant.MSG_NET_CMD_NPC, Constant.SOCKET_MSG_TYPE_LOGIC);
                                MainLogic.getInstance().uiInterFace.npcTalk.openNPCTalk(this.gameNpcArray.strNpcNames[(int) MainLogic.getInstance().iLockedObjNumber[0][1]]);
                            }
                            return;
                        }
                    } else if (!blattack && this.iLockedObjNumber[0][4] == Constant.LOCKED_TYPE_OTHERPLAYER) {
                        //锁定的是其他的玩家
                        GameBean.L_PLAYER_ID = this.iLockedObjNumber[0][0];
                        //发送查看玩家的信息的请求
                        MainLogic.getInstance().pushState(Constant.GAME_UI_VIEW_OTHER_PLAYER, true);
                        if (uiInterFace.sRoamMapKeys.equals("10101") || uiInterFace.sRoamMapKeys.equals("10201")) {
                            uiInterFace.setLockSelect(1);
                        }
                        return;
                    }
                    //没有快捷栏临时配置
                    if (actIndex != -1) {
                        if (MainLogic.getInstance().gamePlayer.blCanUseSkill) {
                            //如果该技能冷却时间未到返回
                            if (index != -1) {
//                                Tools.printLog("玩家使用技能" + Player.iPlayerSkillStartTime[index]);
                                if (Player.iPlayerSkillStartTime != null && Player.iPlayerSkillStartTime[index] == -1) {
                                    if (this.iLockedObjNumber[0][4] == Constant.LOCKED_TYPE_OTHERPLAYER) {
                                        if (uiInterFace.sRoamMapKeys.equals("10101") || uiInterFace.sRoamMapKeys.equals("10201")) {
                                        } else {
                                            if (gamePlayer.blPkState) {
                                            } else {
                                                if (!gamePlayer.blPkState) {
                                                    if (gamePlayer.byPlayerBigState == Constant.PLAYER_BIG_STATE_FIGHT) {
                                                        if (GameBean.BY_SAFE_MAP == 0) {
                                                            MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 5, "安全区禁止恶意pk!");
                                                            return;
                                                        } else {
                                                            if (gamePlayer.iPlayerLevel < 20) {
                                                                MainLogic.getInstance().uiInterFace.uichat_index = 0;
                                                                MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 5, "你涉世未深，不要暗下毒手!");
                                                                return;
                                                            } else if (iLockedObjInfor[0] < 20) {
                                                                MainLogic.getInstance().uiInterFace.uichat_index = 0;
                                                                MainLogic.getInstance().uiEquipment.getChatInformation(100, "", (byte) 5, "对方涉世未深，怎忍心下此毒手!");
                                                                return;
                                                            } else if (gamePlayer.bPkState == 0) {
                                                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您尚未开启PK状态!", (byte) 1, (byte) -1);
                                                                return;
                                                            }
                                                        }
                                                    } else {
                                                        playerFightLogic((byte) 99, false);
                                                        return;
                                                    }
                                                }
                                            }
                                        }
                                    }
//                                    if ((byte) MainLogic.iLockedObjNumber[0][1] != Constant.NPC_TYPE_CANNOTATTACK) {
                                    gamePlayer.playerUseSkill(index, true, true);
//                                    }
                                }
                            } else {
                                return;
                            }
                        }
                    }
                }
            }
        }
    }

    /**
     * 得到技能ID
     */
    public int getQuickSetID(int selectindex) {
        int index = -1;
        if (UiInterFace.gameSet.QuickSet[selectindex][0] != null && Player.strPlayerSkill != null) {
            for (int j = 0; j < Player.strPlayerSkill.length; j++) {
                if (Player.strPlayerSkill[j] != null && UiInterFace.gameSet.QuickSet[selectindex][3].equals(Player.strPlayerSkill[j])) {
                    index = j;
                    return index;
                }
            }
        }
        return index;
    }

    public byte getQuickSetFuncID(int selectindex) {
        byte index = -1;
        if (UiInterFace.gameSet.QuickSet[selectindex][0] != null) {
            return Byte.parseByte(UiInterFace.gameSet.QuickSet[selectindex][3]);
        }
        return index;
    }

    public int getQuickSetType(int selectindex) {
        int index = -1;
        if (selectindex == 99) {
            return -1;
        }
        if (UiInterFace.gameSet.QuickSet[selectindex][0] != null) {
            index = Integer.parseInt(UiInterFace.gameSet.QuickSet[selectindex][1]);
            return index;
        }
        return index;
    }
    public int iLockedPartW = 120;
    public int iLockedPartH = 120;
    public int iLockedOtherplayerW = 120;
    public int iLockedOtherplayerH = 120;
    public static int iLockedNPCW = 48;
    public static int iLockedNPCH = 48;
    public boolean isLocked;

    public void lockedObj(int x, int y) {
        //锁定玩家
        int length = gameOtherplayerArray.shOtherIds.length - 1;
        //锁定npc
        int npclength = gameNpcArray.shNpcIds.length - 1;
        long[][] LockedObj = {{-1, -1, -1, -1, -1, -1}};
        long[][] npc_cannotAtt = {{-1, -1, -1, -1, -1, -1}};
        long[][] otherPlayer = {{-1, -1, -1, -1, -1, -1}};
        long[][] npc_canAtt = {{-1, -1, -1, -1, -1, -1}};
        int npc_cannotAttLen = 0;
        int otherPlayerLen = 0;
        int npc_canAttLen = 0;
        //锁定玩家
//        if (npclength > 1) {
        if (!GameBean.BL_PLAYER_HANGUP) {
            for (int i = npclength; i >= 0; i--) {
                if (gameNpcArray.shNpcIds[i] != -1 && gameNpcArray.shNpcTypes[i] == Constant.NPC_TYPE_CANNOTATTACK && gameNpcArray.shNpcgender[i] != 3 && gameNpcArray.shNpcgender[i] != 4) {
                    if (gameNpcArray.iNpcXs[i] >= x - iLockedNPCW && gameNpcArray.iNpcXs[i] <= x + iLockedNPCW && (gameNpcArray.iNpcYs[i] >= y - iLockedNPCH && gameNpcArray.iNpcYs[i] <= y + iLockedNPCH)) {
//                    Tools.printLog("gameNpcArray.shNpcTypes[i]  :: " + gameNpcArray.shNpcTypes[i]);
                        npc_cannotAttLen = npc_cannotAtt.length;
                        npc_cannotAtt[npc_cannotAttLen - 1][0] = gameNpcArray.shNpcIds[i];
                        npc_cannotAtt[npc_cannotAttLen - 1][1] = i;
                        npc_cannotAtt[npc_cannotAttLen - 1][2] = gameNpcArray.iNpcXs[i];
                        npc_cannotAtt[npc_cannotAttLen - 1][3] = gameNpcArray.iNpcYs[i];
                        npc_cannotAtt[npc_cannotAttLen - 1][4] = Constant.LOCKED_TYPE_NPC;
                        npc_cannotAtt[npc_cannotAttLen - 1][5] = 0;
                        npc_cannotAtt = resizeArray(npc_cannotAtt);
//                    LockedObjLen = LockedObj.length;
//                    LockedObj[LockedObjLen - 1][0] = gameNpcArray.shNpcIds[i];
//                    LockedObj[LockedObjLen - 1][1] = i;
//                    LockedObj[LockedObjLen - 1][2] = gameNpcArray.iNpcXs[i];
//                    LockedObj[LockedObjLen - 1][3] = gameNpcArray.iNpcYs[i];
//                    LockedObj[LockedObjLen - 1][4] = Constant.LOCKED_TYPE_NPC;
//                    LockedObj[LockedObjLen - 1][5] = 0;
//                    LockedObj = resizeArray(LockedObj);
                        //记录锁定的npc的类型和索引
                    }
                }
            }
            /////////////////

            npc_cannotAtt = quickSort(npc_cannotAtt, x, y);
//        for (int c = 0; c < npc_cannotAtt.length; c++) {
//            Tools.printLog("aa " + (c + 1) + ":: " + npc_cannotAtt[c][0] + " " + npc_cannotAtt[c][1]
//                    + " " + npc_cannotAtt[c][2] + " " + npc_cannotAtt[c][3] + " "
//                    + npc_cannotAtt[c][4] + " " + npc_cannotAtt[c][5] + " ");
//        }
            LockedObj = addArray(npc_cannotAtt, LockedObj);
        }
        ////////////////////////////
        String npcIds = "";
        if (GameBean.BL_PLAYER_HANGUP) {
            for (int i = npclength; i >= 0; i--) {
                if (gameNpcArray.shNpcIds[i] != -1
                        && gameNpcArray.shNpcTypes[i] == Constant.NPC_TYPE_CANATTACK
                        && gameNpcArray.shNpcgender[i] != 3
                        && gameNpcArray.shNpcgender[i] != 4) {
                    {
                        npc_canAttLen = npc_canAtt.length;
                        npc_canAtt[npc_canAttLen - 1][0] = gameNpcArray.shNpcIds[i];
                        npc_canAtt[npc_canAttLen - 1][1] = i;
                        npc_canAtt[npc_canAttLen - 1][2] = gameNpcArray.iNpcXs[i];
                        npc_canAtt[npc_canAttLen - 1][3] = gameNpcArray.iNpcYs[i];
                        npc_canAtt[npc_canAttLen - 1][4] = Constant.LOCKED_TYPE_NPC;
                        npc_canAtt[npc_canAttLen - 1][5] = 0;
                        npc_canAtt = resizeArray(npc_canAtt);
//                    LockedObjLen = LockedObj.length;
//                    LockedObj[LockedObjLen - 1][0] = gameNpcArray.shNpcIds[i];
//                    LockedObj[LockedObjLen - 1][1] = i;
//                    LockedObj[LockedObjLen - 1][2] = gameNpcArray.iNpcXs[i];
//                    LockedObj[LockedObjLen - 1][3] = gameNpcArray.iNpcYs[i];
//                    LockedObj[LockedObjLen - 1][4] = Constant.LOCKED_TYPE_NPC;
//                    LockedObj[LockedObjLen - 1][5] = 0;
//                    LockedObj = resizeArray(LockedObj);
                        if (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] == 2
                                && MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] == 3) {
                            npcIds = gameNpcArray.strNpcResIds[i];
                        }
//                    break;
                    }
                }
            }
        } else {
            for (int i = npclength; i >= 0; i--) {
                if (gameNpcArray.shNpcIds[i] != -1
                        && gameNpcArray.shNpcTypes[i] == Constant.NPC_TYPE_CANATTACK
                        && gameNpcArray.shNpcgender[i] != 3
                        && gameNpcArray.shNpcgender[i] != 4) {
                    if (gameNpcArray.iNpcXs[i] >= x - iLockedPartW
                            && gameNpcArray.iNpcXs[i] <= x + iLockedPartW
                            && (gameNpcArray.iNpcYs[i] >= y - iLockedPartH
                            && gameNpcArray.iNpcYs[i] <= y + iLockedPartH)) {
                        npc_canAttLen = npc_canAtt.length;
                        npc_canAtt[npc_canAttLen - 1][0] = gameNpcArray.shNpcIds[i];
                        npc_canAtt[npc_canAttLen - 1][1] = i;
                        npc_canAtt[npc_canAttLen - 1][2] = gameNpcArray.iNpcXs[i];
                        npc_canAtt[npc_canAttLen - 1][3] = gameNpcArray.iNpcYs[i];
                        npc_canAtt[npc_canAttLen - 1][4] = Constant.LOCKED_TYPE_NPC;
                        npc_canAtt[npc_canAttLen - 1][5] = 0;
                        npc_canAtt = resizeArray(npc_canAtt);
//                    LockedObjLen = LockedObj.length;
//                    LockedObj[LockedObjLen - 1][0] = gameNpcArray.shNpcIds[i];
//                    LockedObj[LockedObjLen - 1][1] = i;
//                    LockedObj[LockedObjLen - 1][2] = gameNpcArray.iNpcXs[i];
//                    LockedObj[LockedObjLen - 1][3] = gameNpcArray.iNpcYs[i];
//                    LockedObj[LockedObjLen - 1][4] = Constant.LOCKED_TYPE_NPC;
//                    LockedObj[LockedObjLen - 1][5] = 0;
//                    LockedObj = resizeArray(LockedObj);
                        if (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] == 2
                                && MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] == 3) {
                            npcIds = gameNpcArray.strNpcResIds[i];
                        }
                    }
                }
            }
        }
        /////////////////
        npc_canAtt = quickSort(npc_canAtt, x, y);
//        for (int c = 0; c < npc_canAtt.length; c++) {
//            Tools.printLog("cc " + (c + 1) + ":: " + npc_canAtt[c][0] + " " + npc_canAtt[c][1]
//                    + " " + npc_canAtt[c][2] + " " + npc_canAtt[c][3] + " "
//                    + npc_canAtt[c][4] + " " + npc_canAtt[c][5] + " ");
//        }
        LockedObj = addArray(npc_canAtt, LockedObj);
//        for (int c = 0; c < LockedObj.length; c++) {
//            Tools.printLog("好" + (c + 1) + ":: " + LockedObj[c][0] + " " + LockedObj[c][1]
//                    + " " + LockedObj[c][2] + " " + LockedObj[c][3] + " "
//                    + LockedObj[c][4] + " " + LockedObj[c][5] + " ");
//        }
        ////////////////////////////
        if (!GameBean.BL_PLAYER_HANGUP) {
            for (int i = length; i >= 0; i--) {
                if (gameOtherplayerArray.shOtherIds[i] != -1) {
                    if (gameOtherplayerArray.iOtherXs[i] >= x - iLockedOtherplayerW
                            && gameOtherplayerArray.iOtherXs[i] <= x + iLockedOtherplayerW
                            && (gameOtherplayerArray.iOtherYs[i] >= y - iLockedOtherplayerH
                            && gameOtherplayerArray.iOtherYs[i] <= y + iLockedOtherplayerH)
                            && gameOtherplayerArray.byOtherState[i] != Constant.PLAYER_STATE_DIE) {
                        if ((MainLogic.getInstance().uiInterFace.team.getMemberPos(gameOtherplayerArray.shOtherIds[i]) == -1)
                                && !MainLogic.getInstance().uiEquipment.isopenset[20]) {
                        } else {
                            otherPlayerLen = otherPlayer.length;
                            otherPlayer[otherPlayerLen - 1][0] = gameOtherplayerArray.shOtherIds[i];
                            otherPlayer[otherPlayerLen - 1][1] = i;
                            otherPlayer[otherPlayerLen - 1][2] = gameOtherplayerArray.iOtherXs[i];
                            otherPlayer[otherPlayerLen - 1][3] = gameOtherplayerArray.iOtherYs[i];
                            otherPlayer[otherPlayerLen - 1][4] = Constant.LOCKED_TYPE_OTHERPLAYER;
                            otherPlayer[otherPlayerLen - 1][5] = 0;
                            otherPlayer = resizeArray(otherPlayer);
                        }
//                    LockedObjLen = LockedObj.length;
//                    LockedObj[LockedObjLen - 1][0] = gameOtherplayerArray.shOtherIds[i];
//                    LockedObj[LockedObjLen - 1][1] = i;
//                    LockedObj[LockedObjLen - 1][2] = gameOtherplayerArray.iOtherXs[i];
//                    LockedObj[LockedObjLen - 1][3] = gameOtherplayerArray.iOtherYs[i];
//                    LockedObj[LockedObjLen - 1][4] = Constant.LOCKED_TYPE_OTHERPLAYER;
//                    LockedObj[LockedObjLen - 1][5] = 0;
//                    LockedObj = resizeArray(LockedObj);
                    }
                }
            }
            /////////////////
            otherPlayer = quickSort(otherPlayer, x, y);
//        for (int c = 0; c < otherPlayer.length; c++) {
//            Tools.printLog("bb " + (c + 1) + ":: " + otherPlayer[c][0] + " " + otherPlayer[c][1]
//                    + " " + otherPlayer[c][2] + " " + otherPlayer[c][3] + " "
//                    + otherPlayer[c][4] + " " + otherPlayer[c][5] + " ");
//        }
            LockedObj = addArray(otherPlayer, LockedObj);
        }
        ///////////////
        if (LockedObj_index > LockedObj.length - 1) {
            LockedObj_index = 0;
        }
//        Tools.printLog("LockedObj  ::: " + LockedObj.length);
        if (LockedObj[LockedObj_index][0] != -1) {
            this.iLockedObjNumber[0][0] = LockedObj[LockedObj_index][0];
            this.iLockedObjNumber[0][1] = LockedObj[LockedObj_index][1];
            this.iLockedObjNumber[0][2] = LockedObj[LockedObj_index][2];
            this.iLockedObjNumber[0][3] = LockedObj[LockedObj_index][3];
            this.iLockedObjNumber[0][4] = LockedObj[LockedObj_index][4];
            this.iLockedObjNumber[0][5] = LockedObj[LockedObj_index][5];
            if (this.iLockedObjNumber[0][4] == Constant.LOCKED_TYPE_OTHERPLAYER) {
//                short index = (short) MainLogic.getInstance().iLockedObjNumber[0][1];
//                GameBean.L_PLAYER_ID = MainLogic.getInstance().gameOtherplayerArray.shOtherIds[index];
                GameBean.L_PLAYER_ID = MainLogic.iLockedObjNumber[0][0];
//                if (!this.bSendLockedNpcInfo) {
//                System.out.println("向服务器发送获得npc的信息");
                this.send(Constant.MSG_NET_CMD_OTHER_PLAYER_INFO, Constant.SOCKET_MSG_TYPE_LOGIC);
                send(Constant.MSG_NET_BUFF_OPT, Constant.SOCKET_MSG_TYPE_LOGIC);
//                }
//                if (!bSendLockedNpcInfo) {
//                    bSendLockedNpcInfo = true;
//                    MainLogic.netController.send(Constant.MSG_NET_CMD_NPC, Constant.SOCKET_MSG_TYPE_LOGIC);
//                }
            } else if (this.iLockedObjNumber[0][4] == Constant.LOCKED_TYPE_NPC) {
                GameBean.L_PLAYER_ID = MainLogic.iLockedObjNumber[0][0];
//                System.out.println("向服务器发送获得npc的信息");
                send(Constant.MSG_NET_CMD_NPC_INFO, Constant.SOCKET_MSG_TYPE_LOGIC);
                if ((byte) (gameNpcArray.shNpcTypes[(int) LockedObj[LockedObj_index][1]]) == Constant.NPC_TYPE_CANATTACK) {
                    send(Constant.MSG_NET_BUFF_OPT, Constant.SOCKET_MSG_TYPE_LOGIC);
                }
            }
//            System.out.println("MainLogic.getInstance().uiInterFace.sysMessage.StateGuide  " + MainLogic.getInstance().uiInterFace.sysMessage.StateGuide);
//            System.out.println("GameBean.STR_CMD_QUEST_KEY dd   " + GameBean.STR_CMD_QUEST_KEY);
//            System.out.println("npcIds   " + npcIds);
            if (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] == 2
                    && MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] == 3) {
                if (npcIds.equals("255")) {
                    MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 2, 4);
                    MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 2;
                    MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 4;
                }
            }
            npcIds = null;
            LockedObj = null;
            npc_cannotAtt = null;
            otherPlayer = null;
            npc_canAtt = null;
        }
    }
    public static long[] touchLockedObj_npcid;
    public static boolean istouchNpc_fire, first_touchNpc_fire, oncetouch;
    //数组的排序

    public static long[][] quickSort(long[][] arr, int x, int y) {
        int i, j;
        long[] temp = new long[arr[0].length];
        long[][] array = arr;
        //n个元素的数组进行n-1轮排序
        if (array.length > 2) {
            for (i = 0; i < array.length - 2; i++) {//由于数组最后一行不需要排序所以减2，否则减1
                //因为每一轮循环将确定一个数组元素的位置,
                //所以每一轮的比较次数将会递减
                for (j = 0; j < array.length - i - 2; j++) {
                    if ((Math.abs(array[j][2] - x) * Math.abs(array[j][2] - x))
                            + (Math.abs(array[j][3] - y) * Math.abs(array[j][3] - y))
                            > (Math.abs(array[j + 1][2] - x) * Math.abs(array[j + 1][2] - x))
                            + (Math.abs(array[j + 1][3] - y) * Math.abs(array[j + 1][3] - y))) {
                        //如果第j个元素比它后面的相邻的元素大的话就交换
                        System.arraycopy(array[j], 0, temp, 0, array[j].length);
                        System.arraycopy(array[j + 1], 0, array[j], 0, array[j].length);
                        System.arraycopy(temp, 0, array[j + 1], 0, array[j].length);
                    }
                }
            }
        }
//        for (int c = 0; c < array.length; c++) {
//            Tools.printLog("好" + (c + 1) + ":: " + array[c][0] + " " + array[c][1] + " " + array[c][2] + " " + array[c][3] + " "
//                    + array[c][4] + " " + array[c][5] + " ");
//        }
        //打印出排序后的数组
        return array;
    }
    //把一个数组添加到另一个数组中

    public long[][] addArray(long[][] addarray, long[][] array) {//把第一个数组加到第二个数组的后面
        int lenadd = addarray.length;
        if (addarray[0][0] == -1) {
            return array;
        } else {
            lenadd = addarray.length - 1;
        }
        int lenarr;
        if (array[0][0] == -1
                || array[0][0] == 0) {
            lenarr = 0;
        } else {
            lenarr = array.length;
        }
        long[][] tmp = new long[lenarr + lenadd][6];

        for (int i = 0; i < lenarr; i++) {
            System.arraycopy(array[i], 0, tmp[i], 0, 6);
        }
        for (int i = 0; i < lenadd; i++) {
            System.arraycopy(addarray[i], 0, tmp[i + lenarr], 0, 6);
        }
        array = new long[lenarr + lenadd][6];
        array = tmp;
//        for (int i = 0; i < array.length; i++) {
//            Tools.printLog((i + 1) + " " + array[i][0] + " " + array[i][1] + " " + array[i][2] + " " + array[i][3] + " "
//                    + array[i][4] + " " + array[i][5] + " ");
//        }
        return array;
    }
    //改变数组大小

    public long[][] resizeArray(long[][] array) {
        int len = array.length;
        long[][] tmp = array;
        array = new long[len + 1][6];
        for (int i = 0; i < len; i++) {
            System.arraycopy(tmp[i], 0, array[i], 0, 6);
        }
        return array;
    }
    public static int LockedObjLen;
    public static int LockedObj_index;
    //更新锁定

    public void updateLockedObj() {
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_0, false)) {
            SkillBuffManager.clearBuffTable();
            if (this.iLockedObjNumber[0][0] != -1) {
                LockedObj_index++;
                lockedObj(this.gamePlayer.iPlayerX, this.gamePlayer.iPlayerY);
            } else {
                LockedObj_index = 0;
                lockedObj(this.gamePlayer.iPlayerX, this.gamePlayer.iPlayerY);
            }
        }
        if (isLocked) {
            MainLogic.getInstance().clearLockedObj(0, true);
            isLocked = false;
        }
    }

    public void clearLockedObj(int index, boolean clearAll) {
        if (clearAll) {
            for (int i = Constant.MAX_LOCKED_MAXNUMS - 1; i >= 0; i--) {
                this.iLockedObjNumber[i][0] = -1;
                this.iLockedObjNumber[i][1] = -1;
                this.iLockedObjNumber[i][2] = -1;
                this.iLockedObjNumber[i][3] = -1;
                this.iLockedObjNumber[i][4] = -1;
                this.iLockedObjNumber[i][5] = -1;
            }
        } else {
            this.iLockedObjNumber[index][0] = -1;
            this.iLockedObjNumber[index][1] = -1;
            this.iLockedObjNumber[index][2] = -1;
            this.iLockedObjNumber[index][3] = -1;
            this.iLockedObjNumber[index][4] = -1;
            this.iLockedObjNumber[index][5] = -1;
        }
        this.clearLockedInfor();
        SkillBuffManager.clearBuffTable();
//        LockedObj_index = 0;
//        LockedObj = new long[1][6];
    }
    private int[] m_delays = new int[5];
    private int m_count = 0;
    private int MAX_DELAY = 5;
    public static long lGSOrigDelta = 0L;

    public void setDelayTime(int _delay) {
        m_delays[m_count++] = _delay;
        if (Math.abs(_delay - lCSDelayTime) < Math.abs(lCSDelayTime * 3 / 2)) {
            lCSDelayTime += _delay;
            lCSDelayTime /= 2;
        }
        if (m_count == MAX_DELAY) //排序，求出平均值
        {
            for (int i = 0; i < MAX_DELAY; ++i) //排序
            {
                int idx = i;
                for (int j = i + 1; j < MAX_DELAY; ++j) {
                    if (m_delays[idx] > m_delays[j]) {
                        idx = j;
                    }
                }
                int tmp = m_delays[idx];
                m_delays[idx] = m_delays[i];
                m_delays[i] = tmp;
            }
            //
            int median = Math.abs(m_delays[MAX_DELAY / 2]);
            int deleta = median * 3 / 2;
            int total = 0;
            int k = 0;
            for (int i = 0; i < MAX_DELAY; ++i) {
                if (Math.abs(m_delays[i] - median) < deleta) {
                    total += m_delays[i];
                    k++;
                }
            }
//            for (int i = 0; i < MAX_DELAY; ++i) {
//                Tools.printLog("delays is " + m_delays[i]);
//            }
            if (k != 0) {
                lCSDelayTime += (total / k);
                lCSDelayTime /= 2;
            }
            for (int j = 0; j < MAX_DELAY; j++) {
                m_delays[j] = 0;
            }
            m_count = 0;
        }
    }

    public static void addLockedInfor(long npcId, int npclv, int iNpcMaxHp, int iNpcHp, int iNpcMaxMp, int iNpcMp, byte difficulty, int headId) {
//        Tools.printLog("添加锁定目标" + npclv);
//        System.out.println("锁定npc");
        if (iLockedObjNumber[0][0] == -1) {
            return;
        }
        if (iLockedObjInfor == null) {
            iLockedObjInfor = new int[5];
        }
        if (npclv != -1) {
            iLockedObjInfor[0] = npclv;
        }
        if (iNpcMaxHp != -1) {
            iLockedObjInfor[1] = iNpcMaxHp;
            iLockedObjInfor[2] = iNpcHp;
            iLockedObjInfor[3] = iNpcMaxMp;
            iLockedObjInfor[4] = iNpcMp;
        }
        if (difficulty != -1) {
            bLockedDifficulty = difficulty;
        }
        if (npcId != -1) {
            lLockedId = npcId;
        }
        if (headId != -1) {
            MainLogic.getInstance().uiInterFace.roamImgUiArray[6] = ResManager.createImage(headId);
        }
        iLockedObjNumber[0][5] = 1;
    }

    public static void addLockedInfor(long otherId, int otherPlayerlv, int otherPlayerMaxHp, int otherPlayerHp, int otherPlayerMaxMp,
            int otherPlayerMp, byte otherPlayerSex, byte otherPlayerDuty, String tongNo) {
        bSendLockedNpcInfo = false;
//        System.out.println("收到打开npc的返回信息");
        if (iLockedObjNumber[0][0] == -1) {
            return;
        }
        if (iLockedObjInfor == null) {
            iLockedObjInfor = new int[5];
        }
        if (otherPlayerlv != -1) {
            iLockedObjInfor[0] = otherPlayerlv;
        }
        iLockedObjInfor[1] = otherPlayerMaxHp;
        iLockedObjInfor[2] = otherPlayerHp;
        iLockedObjInfor[3] = otherPlayerMaxMp;
        iLockedObjInfor[4] = otherPlayerMp;
        lLockedId = otherId;
        bLockedSex = otherPlayerSex;
        bLockedDuty = otherPlayerDuty;
        sLockedTongNo = tongNo;
        iLockedObjNumber[0][5] = 1;
    }

    public static void clearLockedInfor() {
        iLockedObjInfor = null;
    }

    //重新登录
    public void exitGame() {
        //关闭网络连接清理资源
        MainLogic.getInstance().bClientIsReady = false;
        NetManager.getInstance().closeConnect();
//        MainLogic.getInstance().uiLogin.clearUiLogin();
        this.pushState(Constant.GAME_UI_OPTION_LIST, true);
        this.blLogined = false;
        uiInterFace.bRoamUIInit = false;
        bSendOnScreen = false;
//        MainGame.instance.quitApp();
    }
    //退出游戏 

    public void quitGame() {
        //关闭网络连接清理资源
        NetManager.getInstance().closeConnect();
        MainGame.instance.quitApp();
    }
    //
    //引导等待初始化
    public static boolean initMLogicWaiting;

    public void initGuidefinish() {
        switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0]) {
            case 1: {
                switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                    case 2:
//                        System.out.println("vvvvvvvvvvvvvvvvcccccccccccccccccccccccccccccccccc");
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 1, 3);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 1;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;
                        MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                        break;
                }
                break;
            }
            case 2: {
                switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                    case 1:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 2, 1);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 2;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 1;
                        break;
                }
                break;
            }
            case 3: {
                switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                    case 1:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 3, 2);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 3;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 2;
                        break;
                    case 7:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 3, 8);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 3;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 8;
                        MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                        break;
                }
                break;

            }
            case 5: {
                switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                    case 1:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 5, 2);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 5;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 2;
                        break;
                    case 7:
                        //#if NOKIA_E72
//#                         MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                        //#elif NOKIA_S60V5
                         MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                        //#else
//#                        MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                        //#endif
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 5;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 8;
                        MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                        MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                        break;
                    case 9:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 5, 10);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 5;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 10;
                        MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                        break;
                }
                break;
            }
            case 6: {
                switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                    case 1:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 6, 2);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 6;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 2;
                        break;
                    case 7:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 6, 8);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 6;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 8;
                        MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                        MainLogic.getInstance().uiInterFace.gameSet.skillQuickSetindex = 3;
                        break;
                }
                break;
            }
            case 7: {
                switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                    case 2:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 7, 3);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 7;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;
                        MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                        break;
                    case 3:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 7, 4);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 7;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 4;
                        MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                        break;
                    case 6:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 7, 7);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 7;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 7;
                        MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                        break;
                }
                break;
            }
            case 9: {
                switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                    case 1:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 9, 2);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 9;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 2;
                        break;
                }
                break;
            }
            case 11: {
                switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                    case 2:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 11, 3);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 11;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;
                        MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                        break;
                }
                break;
            }
            case 12: {
                switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                    case 2:
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 12;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;

                        int rect_h = Constant.FONT_SMALL.getHeight() * 5 + 14 + 8;
                        int y = (Constant.SCREEN_HEIGHT - rect_h) / 2 + 7;
                        MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, y - 5, Constant.SCREEN_WIDTH - 10, 23);
                        MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                        MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                        break;
                    case 3:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 12, 4);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 12;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 4;
                        MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                        MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = false;
                        break;
                    case 5:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 12, 6);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 12;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 6;
                        MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                        MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = false;
                        break;
                }
                break;
            }
            case 14: {
                switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                    case 2:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 14, 3);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 14;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;
                        MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                        break;
                }
                break;
            }
            case 15: {
                switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                    case 2:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 15, 3);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 15;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;
                        MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                        break;
                }
                break;
            }
            case 16: {
                switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                    case 3:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 16, 4);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 16;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 4;
                        MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                        break;
                }
                break;
            }
            case 27: {
                switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                    case 2:
                        MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 27, 3);
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 27;
                        MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;
                        MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                        break;
                }
                break;
            }
        }
    }
    //引导逻辑

    public void updateUIGuide() {
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {
            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = false;
            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = false;
            MainLogic.getInstance().uiInterFace.sysMessage.clearGuide();
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                || MainCanvas.keyPressedLogic(Constant.GAME_KEY_5, false)
                || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)) {

            switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0]) {
                case 1: {
                    switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                        case 1:
                            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = true;
                            MainLogic.getInstance().uiInterFace.setMenu((byte) 1, (byte) MainLogic.getInstance().uiInterFace.iSelectIndex, 1);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 1;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 2;

                            //#if NOKIA_E72
//#                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                            //#elif NOKIA_S60V5
                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                            //#else
//#                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                            //#endif
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            break;
                        case 2:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().send(Constant.MSG_NET_CMD_OPEN_PROPERTY_POINT, Constant.SOCKET_MSG_TYPE_LOGIC);
//                            System.out.println("vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv");
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 1, 3);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 1;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            break;
                    }
                    break;
                }
                case 2: {
                    switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                        case 1:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.RoamMenuClickOk(MainLogic.getInstance().uiInterFace.iSelectIndex);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 2, 1);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 2;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 1;
                            break;
                        case 2:
                            //不
//                            System.out.println("引导10");
                            if (uiInterFace.npcTalk.bySelectIndex > 1 && uiInterFace.npcTalk.bySelectIndex < uiInterFace.npcTalk.byNumPerPage + 2
                                    && uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 0) != null) {

                                if (GameBean.BY_PRE_GAME_UI_STATE == -1) {
                                    //弹出二级操作层
                                    //发送操作
                                    if (uiInterFace.npcTalk.byTabIndex != 3) {
                                        uiInterFace.npcTalk.sOpArray = new String[]{"1任务寻路", "2任务传送", "3查看详情", "4放弃任务"};
                                    } else {
                                        if (uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 0).charAt(0) == '1' && uiInterFace.npcTalk.bySingleTaskState == 0) {
                                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您等级不够，还不能去接这个任务!");
                                            return;
                                        }
                                        uiInterFace.npcTalk.sOpArray = new String[]{"1任务寻路", "2任务传送"};
                                    }
                                    uiInterFace.npcTalk.byUiState = 1;
                                    uiInterFace.npcTalk.bySubSelectIndex = 1;
                                    //#if NOKIA_S60V5
                                     uiInterFace.npcTalk.iSubPositionY = Constant.UI_START_Y + ((Constant.END_LINE - uiInterFace.npcTalk.sOpArray.length * 37 - 7) >> 1) + 10;
                                    //#else
//#                                    uiInterFace.npcTalk.iSubPositionY = Constant.UI_START_Y + ((Constant.DRAW_HEIGHT - uiInterFace.npcTalk.sOpArray.length * 30 - 7) >> 1) + 7;
                                    //#endif
                                } else {
                                    //插入任务
                                    uiInterFace.npcTalk.insertTask();
                                }
                                /***********************/
                                MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();

                                MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 2;
                                MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;
                                MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect((Constant.DRAW_WIDTH - 90) / 2,
                                        Constant.UI_START_Y + (uiInterFace.npcTalk.bySubSelectIndex - 1) * 30 + uiInterFace.npcTalk.iSubPositionY,
                                        90, 23);
                                MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                                MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                                ///////////////////
                            }
                            break;
                        case 3:
                            //不
                            //////////////////////
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = false;
                            /////////////////////////
                            uiInterFace.npcTalk.bShowMenu = false;
                            GameBean.STR_CMD_QUEST_KEY = uiInterFace.npcTalk.sTaskList[uiInterFace.npcTalk.byTabIndex - 1][((uiInterFace.npcTalk.byPageIndex - 1) * 9 + uiInterFace.npcTalk.bySelectIndex - 2) * 4];
                            switch (uiInterFace.npcTalk.bySubSelectIndex) {
                                case 1:
                                    //任务寻路
//                                    System.out.println("完成引导寻路了");
                                    MainLogic.getInstance().gamePlayer.stopAutoRun(false, true);
                                    MainLogic.getInstance().clearLockedObj(0, true);
                                    MainLogic.getInstance().gamePlayer.runPathFinderForMission(uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 4), Integer.parseInt(uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 5)), Integer.parseInt(uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 6)));
                                    MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, true);
                                    break;
                                case 2:
                                    //任务传送
                                    uiInterFace.npcTalk.send(uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 4), Integer.parseInt(uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 5)), Integer.parseInt(uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 6)));
                                    break;
                                case 3:
                                    //被选中的任务的索引
                                    GameBean.b_WAIT_NET_MSG_BACK = true;
                                    uiInterFace.npcTalk.byUiState = 0;
                                    // 发送查询任务
                                    uiInterFace.npcTalk.sTaskKey = uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 0);
                                    GameBean.STR_CMD_QUEST_KEY = uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 0);
                                    GameBean.L_PLAYER_ID = MainLogic.getInstance().gamePlayer.lPlayerID;
                                    MainLogic.getInstance().send(Constant.MSG_NET_CMD_QUEST_INFO, Constant.SOCKET_MSG_TYPE_LOGIC);
                                    break;
                                case 4:
                                    //放弃任务
                                    uiInterFace.npcTalk.byUiState = 2;
                                    break;
                            }
                            break;
                    }
                    break;
                }
                case 3: {
                    switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                        case 1:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.RoamMenuClickOk(MainLogic.getInstance().uiInterFace.iSelectIndex);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 3, 2);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 3;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 2;
                            break;
                        case 3:
                            //不
                            MainLogic.getInstance().uiPackage.bShowMenu = true;
                            MainLogic.getInstance().uiPackage.byMenuIndex = 0;
                            MainLogic.getInstance().uiPackage.sOpArray = MainLogic.getInstance().uiPackage.getCurrentPackage().getGoodsOpArray(MainLogic.getInstance().uiPackage.shPos);
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();

                            int x = 0,
                             y = 0;

                            //#if NOKIA_S60V5
                             if (MainLogic.getInstance().uiPackage.shPos % 7 == 0) {
                                 x = Constant.UI_START_X + ((Constant.DRAW_WIDTH - 318) >> 1) + 6;
                                 y = MainLogic.getInstance().uiPackage.iStartPointY + 36 + ((MainLogic.getInstance().uiPackage.shPos - (MainLogic.getInstance().uiPackage.byCurrentPage - 1) * 28) / 7) * 44;
                             } else {
                                 x = Constant.UI_START_X + ((Constant.DRAW_WIDTH - 318) >> 1) + 6 + (MainLogic.getInstance().uiPackage.shPos % 7) * 44;
                                 y = MainLogic.getInstance().uiPackage.iStartPointY + 36 + ((MainLogic.getInstance().uiPackage.shPos - (MainLogic.getInstance().uiPackage.byCurrentPage - 1) * 28) / 7) * 44;
                             }
                            //#else
//#                            if (MainLogic.getInstance().uiPackage.shPos % 7 == 0) {
//#                                x = Constant.UI_START_X + ((Constant.DRAW_WIDTH - 232) >> 1) + 5;
//#                                y = MainLogic.getInstance().uiPackage.iStartPointY + 29 + ((MainLogic.getInstance().uiPackage.shPos - (MainLogic.getInstance().uiPackage.byCurrentPage - 1) * 28) / 7) * 32;
//#                            } else {
//#                                x = Constant.UI_START_X + ((Constant.DRAW_WIDTH - 232) >> 1) + 5 + (MainLogic.getInstance().uiPackage.shPos % 7) * 32;
//#                                y = MainLogic.getInstance().uiPackage.iStartPointY + 29 + ((MainLogic.getInstance().uiPackage.shPos - (MainLogic.getInstance().uiPackage.byCurrentPage - 1) * 28) / 7) * 32;
//#                            }
                            //#endif
                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(x, y, Constant.FONT_SMALL.stringWidth("装备") + 10, Constant.FONT_SMALL.getHeight() + 5);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 3;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 4;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            break;
                        case 4:
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            MainLogic.getInstance().uiPackage.getCurrentPackage().sendGoodsOperationMSG(MainLogic.getInstance().uiPackage.shPos, Constant.ITEM_OPERATION_TYPE_EQUIP);
                            MainLogic.getInstance().uiPackage.bShowMenu = false;
                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 3, 5);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 3;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 5;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = false;
                            break;
                        case 6:
                            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = true;
                            MainLogic.getInstance().uiInterFace.setMenu((byte) 1, (byte) MainLogic.getInstance().uiInterFace.iSelectIndex, 2);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 3;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 7;

                            //#if NOKIA_E72
//#                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                            //#elif NOKIA_S60V5
                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                            //#else
//#                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                            //#endif
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            break;
                        case 7:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.RoamMenuClickOk(MainLogic.getInstance().uiInterFace.iSelectIndex);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 3, 8);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 3;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 8;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            break;
                    }
                    break;

                }
                case 5: {
                    switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                        case 1:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.RoamMenuClickOk(MainLogic.getInstance().uiInterFace.iSelectIndex);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 5, 2);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 5;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 2;
                            break;
                        case 3:
                            //不
                            MainLogic.getInstance().uiPackage.bShowMenu = true;
                            MainLogic.getInstance().uiPackage.byMenuIndex = 1;
                            MainLogic.getInstance().uiPackage.sOpArray = MainLogic.getInstance().uiPackage.getCurrentPackage().getGoodsOpArray(MainLogic.getInstance().uiPackage.shPos);
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();

                            int x = 0,
                             y = 0;
                            //
                            //#if NOKIA_S60V5
                             if (MainLogic.getInstance().uiPackage.shPos % 7 == 0) {
                                 x = Constant.UI_START_X + ((Constant.DRAW_WIDTH - 318) >> 1) + 6;
                                 y = MainLogic.getInstance().uiPackage.iStartPointY + 36 + ((MainLogic.getInstance().uiPackage.shPos - (MainLogic.getInstance().uiPackage.byCurrentPage - 1) * 28) / 7) * 44;
                             } else {
                                 x = Constant.UI_START_X + ((Constant.DRAW_WIDTH - 318) >> 1) + 6 + (MainLogic.getInstance().uiPackage.shPos % 7) * 44;
                                 y = MainLogic.getInstance().uiPackage.iStartPointY + 36 + ((MainLogic.getInstance().uiPackage.shPos - (MainLogic.getInstance().uiPackage.byCurrentPage - 1) * 28) / 7) * 44;
                             }
                            //#else
//#                            if (MainLogic.getInstance().uiPackage.shPos % 7 == 0) {
//#                                x = Constant.UI_START_X + ((Constant.DRAW_WIDTH - 232) >> 1) + 5;
//#                                y = MainLogic.getInstance().uiPackage.iStartPointY + 29 + ((MainLogic.getInstance().uiPackage.shPos - (MainLogic.getInstance().uiPackage.byCurrentPage - 1) * 28) / 7) * 32;
//#                            } else {
//#                                x = Constant.UI_START_X + ((Constant.DRAW_WIDTH - 232) >> 1) + 5 + (MainLogic.getInstance().uiPackage.shPos % 7) * 32;
//#                                y = MainLogic.getInstance().uiPackage.iStartPointY + 29 + ((MainLogic.getInstance().uiPackage.shPos - (MainLogic.getInstance().uiPackage.byCurrentPage - 1) * 28) / 7) * 32;
//#                            }
                            //#endif
                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(x, y + Constant.FONT_SMALL.getHeight() + 5, Constant.FONT_SMALL.stringWidth("装备") + 10, Constant.FONT_SMALL.getHeight() + 5);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 5;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 4;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            break;
                        case 4:
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            MainLogic.getInstance().uiPackage.getCurrentPackage().sendGoodsOperationMSG(MainLogic.getInstance().uiPackage.shPos, Constant.ITEM_OPERATION_TYPE_EQUIP);
                            MainLogic.getInstance().uiPackage.bShowMenu = false;
                            MainLogic.getInstance().uiPackage.openBag(Constant.ITEM_COLUMN_TYPE_PET);
                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 5, 5);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 5;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 5;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = false;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            break;
                        case 6:
                            //不
                            MainLogic.getInstance().uiPackage.bShowMenu = true;
                            MainLogic.getInstance().uiPackage.byMenuIndex = 0;
                            MainLogic.getInstance().uiPackage.sOpArray = MainLogic.getInstance().uiPackage.getCurrentPackage().getGoodsOpArray(MainLogic.getInstance().uiPackage.shPos);
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();

                            int x1 = 0,
                             y1 = 0;
                            MainLogic.getInstance().uiInterFace.sysMessage.getGuideGoodColumnKey = MainLogic.getInstance().uiPackage.getCurrentPackage().getGoodsColumnKey(MainLogic.getInstance().uiPackage.shPos);
                            //#if NOKIA_S60V5
                             if (MainLogic.getInstance().uiPackage.shPos % 7 == 0) {
                                 x1 = Constant.UI_START_X + ((Constant.DRAW_WIDTH - 318) >> 1) + 6;
                                 y1 = MainLogic.getInstance().uiPackage.iStartPointY + 36 + ((MainLogic.getInstance().uiPackage.shPos - (MainLogic.getInstance().uiPackage.byCurrentPage - 1) * 28) / 7) * 44;
                             } else {
                                 x1 = Constant.UI_START_X + ((Constant.DRAW_WIDTH - 318) >> 1) + 6 + (MainLogic.getInstance().uiPackage.shPos % 7) * 44;
                                 y1 = MainLogic.getInstance().uiPackage.iStartPointY + 36 + ((MainLogic.getInstance().uiPackage.shPos - (MainLogic.getInstance().uiPackage.byCurrentPage - 1) * 28) / 7) * 44;
                             }
                            //#else
//#                            if (MainLogic.getInstance().uiPackage.shPos % 7 == 0) {
//#                                x1 = Constant.UI_START_X + ((Constant.DRAW_WIDTH - 232) >> 1) + 5;
//#                                y1 = MainLogic.getInstance().uiPackage.iStartPointY + 29 + ((MainLogic.getInstance().uiPackage.shPos - (MainLogic.getInstance().uiPackage.byCurrentPage - 1) * 28) / 7) * 32;
//#                            } else {
//#                                x1 = Constant.UI_START_X + ((Constant.DRAW_WIDTH - 232) >> 1) + 5 + (MainLogic.getInstance().uiPackage.shPos % 7) * 32;
//#                                y1 = MainLogic.getInstance().uiPackage.iStartPointY + 29 + ((MainLogic.getInstance().uiPackage.shPos - (MainLogic.getInstance().uiPackage.byCurrentPage - 1) * 28) / 7) * 32;
//#                            }
                            //#endif
                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(x1, y1, Constant.FONT_SMALL.stringWidth("装备") + 10, Constant.FONT_SMALL.getHeight() + 5);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 5;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 7;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            break;
                        case 7:
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            MainLogic.getInstance().uiPackage.getCurrentPackage().sendGoodsOperationMSG(MainLogic.getInstance().uiPackage.shPos, Constant.ITEM_OPERATION_TYPE_EQUIP);
                            MainLogic.getInstance().uiPackage.bShowMenu = false;
                            Tools.openRoamMenu(false, (byte) 1, (byte) 0, 6);
//                            //#if NOKIA_E72
////#                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
//                            //#elif NOKIA_S60V5
////#                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
//                            //#else
//                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
//                            //#endif
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 5;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 8;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            break;
                        case 8:
                            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = true;
                            MainLogic.getInstance().uiInterFace.setMenu((byte) 1, (byte) MainLogic.getInstance().uiInterFace.iSelectIndex, 1);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 5;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 9;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            //#if NOKIA_E72
//#                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                            //#elif NOKIA_S60V5
                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                            //#else
//#                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                            //#endif
                            break;
                        case 9:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.RoamMenuClickOk(MainLogic.getInstance().uiInterFace.iSelectIndex);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 5, 10);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 5;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 10;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            break;
                        case 11:
                            //不
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.pet.byMenuIndex = 1;
                            MainLogic.getInstance().uiInterFace.pet.byItemSelectIndex = 1;
                            MainLogic.getInstance().uiInterFace.pet.bLock = true;

                            if (MainLogic.getInstance().uiInterFace.pet.iArray[(MainLogic.getInstance().uiInterFace.pet.byItemSelectIndex - 1) * 14 + 3] == 1) {
                                MainLogic.getInstance().uiInterFace.pet.sOpArray = MainLogic.getInstance().uiInterFace.pet.items.getPetOperation(Constant.ITEM_COLUMN_TYPE_PET_EQUIP, (byte) 1);
                            } else {
                                MainLogic.getInstance().uiInterFace.pet.sOpArray = MainLogic.getInstance().uiInterFace.pet.items.getPetOperation(Constant.ITEM_COLUMN_TYPE_PET_EQUIP, (byte) 0);
                            }
                            //#if NOKIA_S60V5
                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(
                                     Constant.UI_START_X + 33 + 50 * (MainLogic.getInstance().uiInterFace.pet.byItemSelectIndex - 1),
                                     Constant.UI_START_Y + 49 + Constant.FONT_SMALL.getHeight() + 5,
                                     Constant.FONT_SMALL.stringWidth("装备") + 10, Constant.FONT_SMALL.getHeight() + 5);
                            //#else
//#                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(
//#                                    MainLogic.getInstance().uiInterFace.pet.startX + 38 * (MainLogic.getInstance().uiInterFace.pet.byItemSelectIndex - 1),
//#                                    MainLogic.getInstance().uiInterFace.pet.startY + 28 + Constant.FONT_SMALL.getHeight() + 5,
//#                                    Constant.FONT_SMALL.stringWidth("装备") + 10, Constant.FONT_SMALL.getHeight() + 5);
                            //#endif
//                            Constant.UI_START_X + 33 + 50 * (this.byItemSelectIndex - 1), Constant.UI_START_Y + 49

                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 5;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 12;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            break;
                        case 12:
                            //不
                            MainLogic.getInstance().uiInterFace.pet.byPetOperation = 3;// 守护
                            GameBean.BY_OP_TYPE = 1;//守护
                            MainLogic.getInstance().uiInterFace.pet.items.sendGoodsOperationMSG((short) (MainLogic.getInstance().uiInterFace.pet.byItemSelectIndex - 1), MainLogic.getInstance().uiInterFace.pet.sOpArray, MainLogic.getInstance().uiInterFace.pet.byMenuIndex);
                            MainLogic.getInstance().uiInterFace.pet.iArray[(MainLogic.getInstance().uiInterFace.pet.byItemSelectIndex - 1) * 14 + 3] = 1;
                            MainLogic.getInstance().uiInterFace.pet.setPetString((byte) (MainLogic.getInstance().uiInterFace.pet.byItemSelectIndex - 1));
                            for (byte i = 0; i < 6; i++) {
                                if (MainLogic.getInstance().uiInterFace.pet.items.checkColumnHasGoods(i) && i != MainLogic.getInstance().uiInterFace.pet.byItemSelectIndex - 1) {
                                    MainLogic.getInstance().uiInterFace.pet.iArray[i * 14 + 3] = 0;
                                }
                            }
                            MainLogic.getInstance().gamePlayer.addPetsAni(MainLogic.getInstance().uiInterFace.pet.iAvatarID[MainLogic.getInstance().uiInterFace.pet.byItemSelectIndex - 1], MainLogic.getInstance().uiInterFace.pet.shPetState[MainLogic.getInstance().uiInterFace.pet.byItemSelectIndex - 1], MainLogic.getInstance().uiInterFace.pet.items.getGoodsAlias((short) (MainLogic.getInstance().uiInterFace.pet.byItemSelectIndex - 1)), (byte) MainLogic.getInstance().uiInterFace.pet.iArray[(MainLogic.getInstance().uiInterFace.pet.byItemSelectIndex - 1) * 14 + 6]);
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = false;
                            MainLogic.getInstance().uiInterFace.pet.bLock = false;
                            break;
                    }
                    break;
                }
                case 6: {
                    switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                        case 1:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.RoamMenuClickOk(MainLogic.getInstance().uiInterFace.iSelectIndex);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 6, 2);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 6;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 2;
                            break;
                        case 3:
                            //不
                            MainLogic.getInstance().uiPackage.bShowMenu = true;
                            MainLogic.getInstance().uiPackage.byMenuIndex = 1;
                            MainLogic.getInstance().uiPackage.sOpArray = MainLogic.getInstance().uiPackage.getCurrentPackage().getGoodsOpArray(MainLogic.getInstance().uiPackage.shPos);
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();

                            int x = 0,
                             y = 0;
                            //#if NOKIA_S60V5
                             if (MainLogic.getInstance().uiPackage.shPos % 7 == 0) {
                                 x = Constant.UI_START_X + ((Constant.DRAW_WIDTH - 318) >> 1) + 6;
                                 y = MainLogic.getInstance().uiPackage.iStartPointY + 36 + ((MainLogic.getInstance().uiPackage.shPos - (MainLogic.getInstance().uiPackage.byCurrentPage - 1) * 28) / 7) * 44;
                             } else {
                                 x = Constant.UI_START_X + ((Constant.DRAW_WIDTH - 318) >> 1) + 6 + (MainLogic.getInstance().uiPackage.shPos % 7) * 44;
                                 y = MainLogic.getInstance().uiPackage.iStartPointY + 36 + ((MainLogic.getInstance().uiPackage.shPos - (MainLogic.getInstance().uiPackage.byCurrentPage - 1) * 28) / 7) * 44;
                             }
                            //#else
//#                            if (MainLogic.getInstance().uiPackage.shPos % 7 == 0) {
//#                                x = Constant.UI_START_X + ((Constant.DRAW_WIDTH - 232) >> 1) + 5;
//#                                y = MainLogic.getInstance().uiPackage.iStartPointY + 29 + ((MainLogic.getInstance().uiPackage.shPos - (MainLogic.getInstance().uiPackage.byCurrentPage - 1) * 28) / 7) * 32;
//#                            } else {
//#                                x = Constant.UI_START_X + ((Constant.DRAW_WIDTH - 232) >> 1) + 5 + (MainLogic.getInstance().uiPackage.shPos % 7) * 32;
//#                                y = MainLogic.getInstance().uiPackage.iStartPointY + 29 + ((MainLogic.getInstance().uiPackage.shPos - (MainLogic.getInstance().uiPackage.byCurrentPage - 1) * 28) / 7) * 32;
//#                            }
                            //#endif
                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(x, y + Constant.FONT_SMALL.getHeight() + 5, Constant.FONT_SMALL.stringWidth("装备") + 10, Constant.FONT_SMALL.getHeight() + 5);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 6;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 4;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            break;
                        case 4:
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            MainLogic.getInstance().uiPackage.getCurrentPackage().sendGoodsOperationMSG(MainLogic.getInstance().uiPackage.shPos, Constant.ITEM_OPERATION_TYPE_EQUIP);
                            MainLogic.getInstance().uiPackage.bShowMenu = false;
                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 6, 5);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 6;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 5;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = false;
                            break;
                        case 6:
                            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = true;
                            MainLogic.getInstance().uiInterFace.setMenu((byte) 1, (byte) MainLogic.getInstance().uiInterFace.iSelectIndex, 1);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 6;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 7;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            //#if NOKIA_E72
//#                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                            //#elif NOKIA_S60V5
                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                            //#else
//#                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                            //#endif
                            break;
                        case 7:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.RoamMenuClickOk(MainLogic.getInstance().uiInterFace.iSelectIndex);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 6, 8);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 6;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 8;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
//                            MainLogic.getInstance().uiInterFace.gameSet.skillQuickSetindex = 3;
                            break;
                    }
                    break;
                }
                case 7: {
                    switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                        case 1:
                            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = true;
                            MainLogic.getInstance().uiInterFace.setMenu((byte) 1, (byte) MainLogic.getInstance().uiInterFace.iSelectIndex, 3);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 7;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 2;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            //#if NOKIA_E72
//#                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                            //#elif NOKIA_S60V5
                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                            //#else
//#                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                            //#endif
                            break;
                        case 2:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.RoamMenuClickOk(MainLogic.getInstance().uiInterFace.iSelectIndex);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 7, 3);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 7;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            break;
                        case 3:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.RoamMenuClickOk(MainLogic.getInstance().uiInterFace.iSelectIndex);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 7, 4);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 7;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 4;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            break;
                        case 5:
                            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = true;
                            MainLogic.getInstance().uiInterFace.setMenu((byte) 1, (byte) MainLogic.getInstance().uiInterFace.iSelectIndex, 3);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 7;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 6;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            //#if NOKIA_E72
//#                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                            //#elif NOKIA_S60V5
                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                            //#else
//#                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                            //#endif
                            break;
                        case 6:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.RoamMenuClickOk(MainLogic.getInstance().uiInterFace.iSelectIndex);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 7, 7);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 7;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 7;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            break;
                        case 8:
                            //不
                            if (MainLogic.uiInterFace.friend.bySelectIndex == 2) {
                                switch (MainLogic.uiInterFace.friend.bySubSelectIndex) {
                                    case 1:
                                        MainLogic.inputInterFace.setInputInterFace((byte) 1, "添加好友");
                                        break;
                                    case 2:
                                        MainLogic.inputInterFace.setInputInterFace((byte) 2, "添加黑名单");
                                        break;
                                }
                                MainGame.changeCanvas(MainLogic.inputInterFace);
                            }
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = false;
                            break;
                    }
                    break;
                }
                case 9: {
                    switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                        case 1:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.RoamMenuClickOk(MainLogic.getInstance().uiInterFace.iSelectIndex);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 9, 2);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 9;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 2;
                            break;
                        case 3:
                            //不
//                            System.out.println("引导10");
                            if (uiInterFace.npcTalk.bySelectIndex > 1 && uiInterFace.npcTalk.bySelectIndex < uiInterFace.npcTalk.byNumPerPage + 2
                                    && uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 0) != null) {

                                if (GameBean.BY_PRE_GAME_UI_STATE == -1) {
                                    //弹出二级操作层
                                    //发送操作
                                    if (uiInterFace.npcTalk.byTabIndex != 3) {
                                        uiInterFace.npcTalk.sOpArray = new String[]{"1任务寻路", "2任务传送", "3查看详情", "4放弃任务"};
                                    } else {
                                        if (uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 0).charAt(0) == '1' && uiInterFace.npcTalk.bySingleTaskState == 0) {
                                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "您等级不够，还不能去接这个任务!");
                                            return;
                                        }
                                        uiInterFace.npcTalk.sOpArray = new String[]{"1任务寻路", "2任务传送"};
                                    }
                                    uiInterFace.npcTalk.byUiState = 1;
                                    uiInterFace.npcTalk.bySubSelectIndex = 2;
                                    //#if NOKIA_S60V5
                                     uiInterFace.npcTalk.iSubPositionY = Constant.UI_START_Y + ((Constant.END_LINE - uiInterFace.npcTalk.sOpArray.length * 37 - 7) >> 1) + 17;
                                    //#else
//#                                    uiInterFace.npcTalk.iSubPositionY = Constant.UI_START_Y + ((Constant.DRAW_HEIGHT - uiInterFace.npcTalk.sOpArray.length * 30 - 7) >> 1) + 7;
                                    //#endif
                                } else {
                                    //插入任务
                                    uiInterFace.npcTalk.insertTask();
                                }
                                /***********************/
                                MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();

                                MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 9;
                                MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 4;
                                MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect((Constant.DRAW_WIDTH - 90) / 2,
                                        Constant.UI_START_Y + (uiInterFace.npcTalk.bySubSelectIndex - 1) * 30 + uiInterFace.npcTalk.iSubPositionY,
                                        90, 23);
                                MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                                MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                                ///////////////////
                            }
                            break;
                        case 4:
                            //不
                            //////////////////////
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = false;
                            /////////////////////////
                            uiInterFace.npcTalk.bShowMenu = false;
                            GameBean.STR_CMD_QUEST_KEY = uiInterFace.npcTalk.sTaskList[uiInterFace.npcTalk.byTabIndex - 1][((uiInterFace.npcTalk.byPageIndex - 1) * 9 + uiInterFace.npcTalk.bySelectIndex - 2) * 4];
                            switch (uiInterFace.npcTalk.bySubSelectIndex) {
                                case 1:
                                    //任务寻路
//                                    System.out.println("完成引导寻路了");
                                    MainLogic.getInstance().gamePlayer.stopAutoRun(false, true);
                                    MainLogic.getInstance().clearLockedObj(0, true);
                                    MainLogic.getInstance().gamePlayer.runPathFinderForMission(uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 4), Integer.parseInt(uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 5)), Integer.parseInt(uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 6)));
                                    MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, true);
                                    break;
                                case 2:
                                    //任务传送
                                    uiInterFace.npcTalk.send(uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 4), Integer.parseInt(uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 5)), Integer.parseInt(uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 6)));
                                    break;
                                case 3:
                                    //被选中的任务的索引
                                    GameBean.b_WAIT_NET_MSG_BACK = true;
                                    uiInterFace.npcTalk.byUiState = 0;
                                    // 发送查询任务
                                    uiInterFace.npcTalk.sTaskKey = uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 0);
                                    GameBean.STR_CMD_QUEST_KEY = uiInterFace.npcTalk.getTaskListArrayIndex((byte) (uiInterFace.npcTalk.bySelectIndex - 2), (byte) 0);
                                    GameBean.L_PLAYER_ID = MainLogic.getInstance().gamePlayer.lPlayerID;
                                    MainLogic.getInstance().send(Constant.MSG_NET_CMD_QUEST_INFO, Constant.SOCKET_MSG_TYPE_LOGIC);
                                    break;
                                case 4:
                                    //放弃任务
                                    uiInterFace.npcTalk.byUiState = 2;
                                    break;

                            }
                            break;
                    }
                    break;
                }
                case 11: {
                    switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                        case 1:
                            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = true;
                            MainLogic.getInstance().uiInterFace.setMenu((byte) 1, (byte) MainLogic.getInstance().uiInterFace.iSelectIndex, 2);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 11;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 2;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            //#if NOKIA_E72
//#                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                            //#elif NOKIA_S60V5
                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                            //#else
//#                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                            //#endif
                            break;
                        case 2:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.RoamMenuClickOk(MainLogic.getInstance().uiInterFace.iSelectIndex);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 11, 3);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 11;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            break;
                    }
                    break;
                }
                case 12: {
                    switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                        case 2:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiEquipment.OperationEmail_index = 0;
                            MainLogic.getInstance().uiEquipment.delet_Email = false;
                            MainLogic.getInstance().uiEquipment.delet_HasreadEmail = false;
                            MainLogic.getInstance().uiEquipment.delet_allEmail = false;
                            MainLogic.getInstance().pushState(Constant.GAME_UI_OPERATION_EMAIL, true);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 12;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
//                            int rect_h = Constant.FONT_SMALL.getHeight() * 5 + 14 + 8;
//                            int y = (Constant.SCREEN_HEIGHT - rect_h) / 2 + 7;
//                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, y - 5, Constant.SCREEN_WIDTH - 10, 23);
                            break;
                        case 3:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiEquipment.Opeartion_type = 0;
                            MainLogic.getInstance().send(Constant.MSG_NET_CMD_MAIL_OPEARTION, Constant.SOCKET_MSG_TYPE_LOGIC);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 12, 4);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 12;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 4;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = false;
                            break;
                        case 5:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiEquipment.Opeartion_type = 1;
                            MainLogic.getInstance().send(Constant.MSG_NET_CMD_MAIL_OPEARTION, Constant.SOCKET_MSG_TYPE_LOGIC);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 12, 6);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 12;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 6;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = false;
                            break;
                    }
                    break;
                }
                case 14: {
                    switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                        case 1:
                            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = true;
                            MainLogic.getInstance().uiInterFace.setMenu((byte) 1, (byte) MainLogic.getInstance().uiInterFace.iSelectIndex, 1);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 14;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 2;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            //#if NOKIA_E72
//#                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                            //#elif NOKIA_S60V5
                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                            //#else
//#                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                            //#endif
                            break;
                        case 2:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.RoamMenuClickOk(MainLogic.getInstance().uiInterFace.iSelectIndex);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 14, 3);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 14;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            break;
                    }
                    break;
                }
                case 15: {
                    switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                        case 1:
                            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = true;
                            MainLogic.getInstance().uiInterFace.setMenu((byte) 1, (byte) MainLogic.getInstance().uiInterFace.iSelectIndex, 3);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 15;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 2;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            //#if NOKIA_E72
//#                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                            //#elif NOKIA_S60V5
                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                            //#else
//#                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                            //#endif
                            break;
                        case 2:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.RoamMenuClickOk(MainLogic.getInstance().uiInterFace.iSelectIndex);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 15, 3);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 15;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            break;
                    }
                    break;
                }
                case 16: {
                    switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                        case 2:
                            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = true;
                            MainLogic.getInstance().uiInterFace.setMenu((byte) 1, (byte) MainLogic.getInstance().uiInterFace.iSelectIndex, 2);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 16;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            //#if NOKIA_E72
//#                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                            //#elif NOKIA_S60V5
                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                            //#else
//#                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                            //#endif
                            break;
                        case 3:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.RoamMenuClickOk(MainLogic.getInstance().uiInterFace.iSelectIndex);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 16, 4);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 16;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 4;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            break;
                    }
                    break;
                }
                case 25: {
                    switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                        case 1:
                            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = true;
                            MainLogic.getInstance().uiInterFace.setMenu((byte) 1, (byte) MainLogic.getInstance().uiInterFace.iSelectIndex, 1);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 25;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 2;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            //#if NOKIA_E72
//#                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                            //#elif NOKIA_S60V5
                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                            //#else
//#                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                            //#endif
                            break;
                        case 2:
                            //不
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().send(Constant.MSG_NET_CMD_OPEN_PROPERTY_POINT, Constant.SOCKET_MSG_TYPE_LOGIC);
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            break;
                    }
                    break;
                }
                case 27: {
                    switch (MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1]) {
                        case 1:
                            MainLogic.getInstance().uiInterFace.bUiKeyPressLock = true;
                            MainLogic.getInstance().uiInterFace.setMenu((byte) 1, (byte) MainLogic.getInstance().uiInterFace.iSelectIndex, 1);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 27;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 2;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = true;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = true;
                            //#if NOKIA_E72
//#                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 35, 23);
                            //#elif NOKIA_S60V5
                             MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(Constant.SCREEN_WIDTH - 59, Constant.SCREEN_HEIGHT - 40, 56, 30);
                            //#else
//#                            MainLogic.getInstance().uiInterFace.sysMessage.initDrawRect(5, Constant.SCREEN_HEIGHT - 25, 28, 23);
                            //#endif
                            break;
                        case 2:
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.RoamMenuClickOk(MainLogic.getInstance().uiInterFace.iSelectIndex);
//                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 27, 3);
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 27;
//                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 3;
//                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            break;
                        case 4:
                            //不
                            MainLogic.getInstance().uiInterFace.sysMessage.clearDrawRect();
                            MainLogic.getInstance().uiInterFace.sysMessage.initGuide("引导", 27, 5);
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][0] = 27;
                            MainLogic.getInstance().uiInterFace.sysMessage.StateGuide[0][1] = 5;
                            MainLogic.getInstance().uiInterFace.sysMessage.isStateGuide = false;
                            MainLogic.getInstance().uiInterFace.sysMessage.isDrawRect = false;
                            break;
                    }
                    break;
                }
            }
            initMLogicWaiting = true;
        }
        MainCanvas.clearInput();
    }
}
